PRD 3 & 4 #26
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: ${{ github.workspace }} | |
| run: | | |
| dotnet publish src/Playground/Playground.Api/Playground.Api.csproj \ | |
| -c Release -r linux-x64 \ | |
| -p:PublishProfile=DefaultContainer \ | |
| -p:ContainerRepository=ghcr.io/${{ github.repository_owner }}/fsh-playground-api \ | |
| -p:ContainerImageTags=${{ github.sha }} | |
| - name: Publish Blazor container image | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| dotnet publish src/Playground/Playground.Blazor/Playground.Blazor.csproj \ | |
| -c Release -r linux-x64 \ | |
| -p:PublishProfile=DefaultContainer \ | |
| -p:ContainerRepository=ghcr.io/${{ github.repository_owner }}/fsh-playground-blazor \ | |
| -p:ContainerImageTags=${{ github.sha }} | |
| - name: Tag images with latest | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| docker tag ghcr.io/${{ github.repository_owner }}/fsh-playground-api:${{ github.sha }} \ | |
| ghcr.io/${{ github.repository_owner }}/fsh-playground-api:latest | |
| docker tag ghcr.io/${{ github.repository_owner }}/fsh-playground-blazor:${{ github.sha }} \ | |
| ghcr.io/${{ github.repository_owner }}/fsh-playground-blazor:latest | |
| - name: Push API images to GHCR | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-api:${{ github.sha }} | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-api:latest | |
| - name: Push Blazor images to GHCR | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-blazor:${{ github.sha }} | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-blazor:latest |