Skip to content

Update publish_to_github_packages.yml #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading