Skip to content

Add GitHub action to publish Docker image #1

Add GitHub action to publish Docker image

Add GitHub action to publish Docker image #1

Workflow file for this run

name: Publish Docker image
on: push
jobs:
publish-images:
name: Publish Docker Images
runs-on: ubuntu-latest
steps:
-
name: Check out repo
uses: actions/checkout@v4
-
name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ GITHUB_REPOSITORY }}

Check failure on line 19 in .github/workflows/publish.yaml

View workflow run for this annotation

GitHub Actions / Publish Docker image

Invalid workflow file

The workflow is not valid. .github/workflows/publish.yaml (Line: 19, Col: 19): Unrecognized named-value: 'GITHUB_REPOSITORY'. Located at position 1 within expression: GITHUB_REPOSITORY
-
name: Login to GitHub Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}