Bump Microsoft.EntityFrameworkCore.SqlServer from 9.0.10 to 9.0.11 #492
Workflow file for this run
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: 'ci' | |
| on: | |
| push: | |
| branches: [ '*' ] | |
| pull_request: | |
| types: [ opened, edited, reopened, synchronize, review_requested ] | |
| branches: [ '*' ] | |
| workflow_call: | |
| env: | |
| TAG_PREFIX: v | |
| DOCKER_IMAGE: btnguyen2k/azpc | |
| jobs: | |
| BuildAndTest: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| dotnet: [ '8.x', '9.x' ] | |
| name: Build and test with dotnet ${{ matrix.dotnet }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup dotnet ${{ matrix.dotnet }} | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet }} | |
| - name: Display dotnet version | |
| run: dotnet --version | |
| - name: Install dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --no-restore | |
| - name: Test | |
| run: dotnet test --no-restore | |
| # - name: Codecov | |
| # uses: codecov/codecov-action@v4 | |
| # with: | |
| # fail_ci_if_error: true | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| ReleaseDryRun: | |
| if: github.event_name == 'push' | |
| needs: BuildAndTest | |
| runs-on: ubuntu-latest | |
| outputs: | |
| RESULT: ${{ steps.release_dry_run.outputs.result }} | |
| VERSION: ${{ steps.release_dry_run.outputs.releaseVersion }} | |
| RELEASE_NOTES: ${{ steps.release_dry_run.outputs.releaseNotes }} | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v5 | |
| - name: Install Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Release (dry-run) | |
| # see https://github.com/btnguyen2k/action-semrelease for documentation | |
| id: release_dry_run | |
| uses: btnguyen2k/action-semrelease@v4 | |
| with: | |
| dry-run: true | |
| auto-mode: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| tag-major-release: false | |
| tag-minor-release: false | |
| branches: ${{ github.ref_name }} | |
| tag-prefix: ${{ env.TAG_PREFIX }} | |
| tag-only: true | |
| TestDockerfileLinux: | |
| needs: BuildAndTest | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| platforms: [ 'linux/amd64', 'linux/arm64' ] | |
| name: Test building Docker image(s) for Linux | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image for ${{ matrix.platforms }} | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: ${{ matrix.platforms }} | |
| push: false | |
| tags: test | |
| file: ./Dockerfile | |
| context: ./ | |
| PublishDockerImagesLinuxBuild: | |
| if: | | |
| needs.ReleaseDryRun.outputs.RESULT == 'SUCCESS' && | |
| github.ref == 'refs/heads/dev' | |
| needs: [ReleaseDryRun, TestDockerfileLinux] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| platforms: [ 'linux/amd64', 'linux/arm64' ] | |
| name: Build Docker image(s) - Linux - Dev Branch | |
| env: | |
| VERSION: ${{ needs.ReleaseDryRun.outputs.VERSION }} | |
| outputs: | |
| VERSION: ${{ needs.ReleaseDryRun.outputs.VERSION }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Update version metadata | |
| run: | | |
| DATE=`date +%Y%m%d%H%M%S` | |
| sed -i -E "s/^(\s*\"Version\"\s*:\s*)\"[^\"]+\"/\1\"${{ env.VERSION }}-${DATE}\"/" AzPC.Api/appsettings.json | |
| sed -i -E "s/^(\s*\"Version\"\s*:\s*)\"[^\"]+\"/\1\"${{ env.VERSION }}-${DATE}\"/" AzPC.Blazor/AzPC.Blazor/appsettings.json | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USER }} | |
| password: ${{ secrets.DOCKER_HUB_PAT }} | |
| - name: Prepare | |
| run: | | |
| platform=${{ matrix.platforms }} | |
| echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.DOCKER_IMAGE }} | |
| - name: Build and push by digest | |
| id: build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: ${{ matrix.platforms }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| outputs: type=image,name=${{ env.DOCKER_IMAGE }},push-by-digest=true,name-canonical=true,push=true | |
| file: ./Dockerfile.dev | |
| context: ./ | |
| - name: Export digest | |
| run: | | |
| mkdir -p /tmp/digests | |
| digest="${{ steps.build.outputs.digest }}" | |
| touch "/tmp/digests/${digest#sha256:}" | |
| - name: Upload digest | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: digests-${{ env.PLATFORM_PAIR }} | |
| path: /tmp/digests/* | |
| if-no-files-found: error | |
| retention-days: 1 | |
| PublishDockerImagesLinuxMerge: | |
| runs-on: ubuntu-latest | |
| needs: PublishDockerImagesLinuxBuild | |
| name: Merge & Publish Docker image(s) - Linux | |
| env: | |
| VERSION: ${{ needs.PublishDockerImagesLinuxBuild.outputs.VERSION }} | |
| steps: | |
| - name: Download digests | |
| uses: actions/download-artifact@v6 | |
| with: | |
| path: /tmp/digests | |
| pattern: digests-* | |
| merge-multiple: true | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.DOCKER_IMAGE }} | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USER }} | |
| password: ${{ secrets.DOCKER_HUB_PAT }} | |
| - name: Create manifest list and push | |
| working-directory: /tmp/digests | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ${{ env.DOCKER_IMAGE }}:dev \ | |
| -t ${{ env.DOCKER_IMAGE }}:${{ env.VERSION }}-dev \ | |
| -t ${{ env.DOCKER_IMAGE }}:latest \ | |
| -t ${{ env.DOCKER_IMAGE }}:${{ github.sha }} \ | |
| $(printf '${{ env.DOCKER_IMAGE }}@sha256:%s ' *) | |
| - name: Inspect image | |
| run: | | |
| docker buildx imagetools inspect ${{ env.DOCKER_IMAGE }}:${{ github.sha }} | |
| - name: Log in to Azure | |
| uses: azure/login@v2 | |
| with: | |
| creds: ${{ secrets.AZURE_CREDENTIALS }} | |
| - name: Deploy to demo environment | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| # note: Once login is done with azure/login action, the next set of Azure actions in the workflow can re-use the same session within the job. | |
| app-name: 'azpc' | |
| images: docker.io/${{ env.DOCKER_IMAGE }}:${{ github.sha }} |