Skip to content

Update dependency FastEndpoints.Swagger to v5.21.2 #1133

Update dependency FastEndpoints.Swagger to v5.21.2

Update dependency FastEndpoints.Swagger to v5.21.2 #1133

name: BuildTestPublish
on:
workflow_dispatch:
workflow_call:
inputs:
publishArtifacts:
required: false
type: boolean
default: false
pull_request:
branches: [ main ]
paths-ignore:
- 'tests/k6/**'
#paths: [ src/**, tests/**, .github/workflows/** ]
jobs:
build-test-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release
- name: Upload azure bicep artifacts for IaC deployment
if: ${{inputs.publishArtifacts}}
uses: actions/upload-artifact@v4
with:
name: azure-artifacts
path: .azure
publish-docker-images:
env:
DOCKER_IMAGE_BASE: ghcr.io/digdir/dialogporten-
needs: build-test-publish
if: ${{inputs.publishArtifacts}}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
include:
- dockerfile: ./src/Digdir.Domain.Dialogporten.WebApi/Dockerfile
imageName: webapi
- dockerfile: ./src/Digdir.Domain.Dialogporten.Service/Dockerfile
imageName: service
- dockerfile: ./src/Digdir.Domain.Dialogporten.ChangeDataCapture/Dockerfile
imageName: cdc
- dockerfile: ./src/Digdir.Domain.Dialogporten.Infrastructure/MigrationBundle.dockerfile
imageName: migration-bundle
- dockerfile: ./RabbitMq/Dockerfile
imageName: rabbitmq
- dockerfile: ./src/Digdir.Tool.Dialogporten.MigrationVerifier/Dockerfile
imageName: migration-verifier
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_IMAGE_BASE }}${{ matrix.imageName }}
- uses: docker/setup-buildx-action@v3
- name: Build and push docker image
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
tags: |
${{ steps.meta.outputs.tags }},
${{ env.DOCKER_IMAGE_BASE }}${{ matrix.imageName }}:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max