Skip to content

Commit

Permalink
👷 #123 Push images to Docker Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-glushko committed Feb 4, 2024
1 parent d67f5eb commit c25985b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
- name: login into Github Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin

- name: login into Github Container Registry
run: echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login -u einstack $ --password-stdin

- name: build ${{ matrix.image }} image
working-directory: ./images
env:
Expand All @@ -81,3 +84,7 @@ jobs:
- name: publish ${{ matrix.image }} image to Github Container Registry
working-directory: ./images
run: VERSION=${{ github.ref_name }} make publish-ghcr-${{ matrix.image }}

- name: publish ${{ matrix.image }} image to Github Container Registry
working-directory: ./images
run: VERSION=${{ github.ref_name }} make publish-docherhub-${{ matrix.image }}
16 changes: 16 additions & 0 deletions images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,19 @@ publish-ghcr-%: ## Push images to Github Registry
docker push ghcr.io/$(REPOSITORY):latest; \
fi; \
}

publish-dockerhub-%: ## Push images to Docker Hub
@echo "🚚Pushing the $* image to Github Registry.."
@docker tag $(REPOSITORY):$(VERSION)-$* $(REPOSITORY):$(VERSION)-$*
@echo "- pushing $(REPOSITORY):$(VERSION)-$*"
@docker push $(REPOSITORY):$(VERSION)-$*
@echo $(VERSION) | grep -q $(RC_PART) || { \
docker tag $(REPOSITORY):$(VERSION)-$* $(REPOSITORY):latest-$*; \
echo "- pushing $(REPOSITORY):latest-$*"; \
docker push $(REPOSITORY):latest-$*; \
if [ "$*" = "alpine" ]; then \
docker tag $(REPOSITORY):$(VERSION)-$* $(REPOSITORY):latest; \
echo "- pushing $(REPOSITORY):latest"; \
docker push $(REPOSITORY):latest; \
fi; \
}

0 comments on commit c25985b

Please sign in to comment.