fix: Append 'latest' tag to container image tags for API and Blazor p… #8
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 | |
| run: | | |
| dotnet publish src/Playground/Playground.Api/Playground.Api.csproj \ | |
| -c Release -r linux-x64 \ | |
| -p:PublishProfile=DefaultContainer \ | |
| -p:ContainerRegistry=ghcr.io \ | |
| -p:ContainerRepository=${{ github.repository_owner }}/fsh-playground-api \ | |
| -p:ContainerImageTags=${{ github.sha }};latest | |
| - name: Publish Blazor container image | |
| run: | | |
| dotnet publish src/Playground/Playground.Blazor/Playground.Blazor.csproj \ | |
| -c Release -r linux-x64 \ | |
| -p:PublishProfile=DefaultContainer \ | |
| -p:ContainerRegistry=ghcr.io \ | |
| -p:ContainerRepository=${{ github.repository_owner }}/fsh-playground-blazor \ | |
| -p:ContainerImageTags=${{ github.sha }};latest | |
| - name: Push API image to GHCR | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-api --all-tags | |
| - name: Push Blazor image to GHCR | |
| run: | | |
| docker push ghcr.io/${{ github.repository_owner }}/fsh-playground-blazor --all-tags |