Skip to content

Commit

Permalink
Update publish_to_github_packages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
TreyWW authored Oct 20, 2024
1 parent a13ffa6 commit e7a5cd6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/publish_to_github_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ jobs:
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Build, tag, and push image to GitHub Packages
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build and push multi-platform image to GitHub Packages
id: build-image
env:
IMAGE_NAME: ghcr.io/treyww/myfinances
Expand All @@ -71,13 +74,11 @@ jobs:
cp infrastructure/backend/Dockerfile ./Dockerfile
echo "VERSION IS: ${{ steps.set_version.outputs.version }} or $IMAGE_TAG"
# Build and push versioned image
docker build -t $IMAGE_NAME:$IMAGE_TAG .
docker push $IMAGE_NAME:$IMAGE_TAG
# Build and push the multi-platform image
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:$IMAGE_TAG . --push
# Optionally build and push 'latest' tag
docker build -t $IMAGE_NAME:latest .
docker push $IMAGE_NAME:latest
docker buildx build --platform linux/amd64,linux/arm64 -t $IMAGE_NAME:latest . --push
echo "::set-output name=image::$IMAGE_NAME:$IMAGE_TAG"
echo "::set-output name=latest_image::$IMAGE_NAME:latest"

0 comments on commit e7a5cd6

Please sign in to comment.