Skip to content

Commit

Permalink
ci: Split up api and web docker image build
Browse files Browse the repository at this point in the history
  • Loading branch information
vyruz1986 committed Nov 11, 2023
1 parent a67295e commit 76269d8
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ on:
push:
branches: [master, blazor-webapp]

env:
REGISTRY: ghcr.io

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
Expand All @@ -20,7 +25,7 @@ jobs:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Install GitVersion
Expand All @@ -34,25 +39,14 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/brixel/door-request-api
${{ env.REGISTRY }}/brixel/door-request-web
images: ${{ matrix.image }}
tags: type=semver,pattern={{version}},value=${{ steps.gitversion.outputs.semVer }}
- name: Build and push API
- name: Build and push docker image
id: docker_build_api
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 }}
- name: Build and push Web
id: docker_build_web
uses: docker/build-push-action@v5
with:
context: .
push: true
file: Web/Dockerfile
file: ${{ matrix.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 76269d8

Please sign in to comment.