Skip to content

chore(deps): update docker/setup-buildx-action action to v3 (#18) #21

chore(deps): update docker/setup-buildx-action action to v3 (#18)

chore(deps): update docker/setup-buildx-action action to v3 (#18) #21

Workflow file for this run

name: Build and publish Container Image
on:
push:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
outputs:
imageTag: ${{ steps.meta.outputs.tags }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy:
name: Deploy backend
runs-on: ubuntu-latest
concurrency: deploy-group # ensure only one action runs at a time
needs: build-and-push-image
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/[email protected]
- run: flyctl deploy --image ${{ needs.build-and-push-image.outputs.imageTag }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_DEPLOY_TOKEN }}