Skip to content

ci: Add docker build/publish action #1

ci: Add docker build/publish action

ci: Add docker build/publish action #1

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: 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: API\DoorRequest.API\Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}