Skip to content
name: 01-ghcr-push
on:
workflow_dispatch
# schedule:
# - cron: '30 22 * * *'

Check failure on line 6 in .github/workflows/ghcr-build-push.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/ghcr-build-push.yaml

Invalid workflow file

You have an error in your yaml syntax on line 6
push:
branches: [ main ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: nmagee/fastapi-demo
IMAGE_TAG: 1.${{ github.run_number }} # GITHUB_RUN_NUMBER }}
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: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_PAT }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
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 }}