fix: Update container publishing configuration for API and Blazor pro… #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and push API & Blazor containers | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: docker login | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish API container image | |
| working-directory: ./src/Playground/Playground.Api/Playground.Api.csproj | |
| run: | | |
| dotnet publish -c Release -p:RuntimeIdentifier=linux-x64 -p:ContainerRepository=${{ github.repository_owner }}/fsh-playground-api -p:ContainerImageTags='${{ github.sha }};latest' | |
| - name: Publish Blazor container image | |
| working-directory: ./src/Playground/Playground.Blazor/Playground.Blazor.csproj | |
| run: | | |
| dotnet publish -c Release -p:RuntimeIdentifier=linux-x64 -p:ContainerRepository=${{ github.repository_owner }}/fsh-playground-blazor -p:ContainerImageTags='${{ github.sha }};latest' | |
| - name: Push API images to GHCR | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-api --all-tags | |
| - name: Push Blazor images to GHCR | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-blazor --all-tags |