name: Publish Docker image on: push: branches: - main jobs: push_to_registry: name: Push Docker image to GitHub Packages runs-on: ubuntu-latest steps: - name: Check out the repo 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: Log in to GitHub container registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker image uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64 push: true tags: ghcr.io/${{ github.repository }}:latest - name: Build and push Docker image arm64 uses: docker/build-push-action@v5 with: context: . platforms: linux/arm64 push: true tags: ghcr.io/${{ github.repository }}:arm64-latest