Skip to content

Tracking in new branch #79

Tracking in new branch

Tracking in new branch #79

Workflow file for this run

name: container-build
on:
push:
branches: [ main ]
env:
REGISTRY: ghcr.io
# Best practice to hard-code your GitHub username below in LOWERCASE.
# Update to your own username.
IMAGE_NAME: nmagee/fastapi-demo
IMAGE_TAG: 1.${{ github.run_number }} # GITHUB_RUN_NUMBER
DOCKER_BUILDKIT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
provenance: false
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
ghcr.io/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}