Skip to content

ci: Split up api and web docker image build #9

ci: Split up api and web docker image build

ci: Split up api and web docker image build #9

Workflow file for this run

name: Publish
on:
push:
branches: [master, blazor-webapp]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
strategy:
fail-fast: false
matrix:
include:
- dockerfile: ./API/DoorRequest.API/Dockerfile
image: ghcr.io/brixel/door-request-api
- dockerfile: ./Web/Dockerfile
image: ghcr.io/brixel/door-request-web
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: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.10.2
with:
versionSpec: "5.x"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.10.2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ matrix.image }}
tags: type=semver,pattern={{version}},value=${{ steps.gitversion.outputs.semVer }}
- name: Build and push docker image
id: docker_build_api
uses: docker/build-push-action@v5
with:
context: .
push: true
file: ${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}