Skip to content

Update docker-publish.yml #19

Update docker-publish.yml

Update docker-publish.yml #19

Workflow file for this run

name: Publish Docker Image
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches:
- master
- main
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches:
- master
- main
permissions:
packages: write
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=sha
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository }}:latest,${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}