Shorthand:
if: matrix.project == 'src/OPI.WebAPI'
Full example:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
project: [
'src/OPI.Client',
'src/OPI.WebAPI',
'src/OPI.WebUI'
]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core SDK ${{ env.DOTNET_VERSION }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore NuGet packages
run: dotnet restore ${{ matrix.project }}
- name: Build
run: dotnet build ${{ matrix.project }} --configuration Release --no-restore
- name: Build docker image for the WebAPI
uses: docker/build-push-action@v4
if: matrix.project == 'src/OPI.WebAPI'
with:
push: false
tags: pr/opiapi:latest
context: src/
file: src/dockerfile.webapi