Log when cancellation was requested #41
This file contains 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: [ "master", "main" ] | |
pull_request: | |
branches: [ "master", "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Fetch all history for all tags and branches | |
run: | | |
git config remote.origin.url https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git fetch --prune --unshallow | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Setup .NET # to build and test before the docker image gets built | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore MaxPower.sln | |
- name: Build | |
run: dotnet build --no-restore --configuration=Release /p:Version=${{steps.gitversion.outputs.semVer}} | |
- name: Test | |
run: dotnet test --no-build --configuration=Release --verbosity normal | |
- name: Build the Docker image | |
run: docker build . --file Dockerfile --tag awaescher/maxpower:${{steps.gitversion.outputs.semVer}} --tag awaescher/maxpower:latest --build-arg SEMVERSION=${{steps.gitversion.outputs.FullSemVer}} --build-arg ASSEMBLYSEMVERSION=${{steps.gitversion.outputs.AssemblySemVer}} | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
if: github.event_name != 'pull_request' | |
- name: Push the Docker image | |
run: docker push awaescher/maxpower:${{steps.gitversion.outputs.semVer}} | |
if: github.event_name != 'pull_request' | |
- name: Push the Docker image latest | |
run: docker push awaescher/maxpower:latest | |
if: github.event_name != 'pull_request' | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{steps.gitversion.outputs.semVer}} | |
name: Release ${{steps.gitversion.outputs.semVer}} | |
if: github.event_name != 'pull_request' |