Skip to content

ci: Fix github action for docker build/publish #2

ci: Fix github action for docker build/publish

ci: Fix github action for docker build/publish #2

Workflow file for this run

name: Publish
on:
push:
branches: [master]
env:
REGISTRY: ghcr.io
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "5.x"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/brixel/haspman-main
tags: type=semver,pattern={{version}},value=${{ steps.gitversion.outputs.semVer }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
push: true
file: HaSpMan.Web.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}