Skip to content

Docker Publish

Docker Publish #1

name: Docker Publish
on:
push:
branches:
- "master"
tags:
- "v*"
workflow_dispatch:
pull_request:
branches:
- "master"
env:
REGISTRY: ghcr.io
REGISTRY_USERNAME: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: ${{ github.repository }}
jobs:
docker_publish:
name: Push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Extract metadata for the Docker image
uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and publish the Docker image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != "pull_request" }}

Check failure on line 45 in .github/workflows/docker-publish.yml

View workflow run for this annotation

GitHub Actions / Docker Publish

Invalid workflow file

The workflow is not valid. .github/workflows/docker-publish.yml (Line: 45, Col: 17): Unexpected symbol: '"pull_request"'. Located at position 22 within expression: github.event_name != "pull_request"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}