more #898
Workflow file for this run
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: Docker | |
on: | |
push: | |
tags: | |
- v* | |
pull_request: | |
env: | |
IMAGE_NAME: OpenAlprWebhookProcessor | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run build | |
run: docker build . --file ./OpenAlprWebhookProcessor.Server/Dockerfile | |
back-end-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.x | |
- name: Restore Dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test | |
run: dotnet test --configuration Release --no-build --collect:"XPlat Code Coverage" --results-directory ./coverage | |
- name: Back End Code Coverage Report | |
uses: irongut/[email protected] | |
with: | |
filename: coverage/**/coverage.cobertura.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '0 80' | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
header: Back End Coverage | |
recreate: true | |
path: code-coverage-results.md | |
front-end-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run frontend tests | |
working-directory: ./openalprwebhookprocessor.client | |
run: | | |
npm ci | |
npm run test:prod | |
npm run lint | |
- name: Front End Code Coverage Report | |
uses: irongut/[email protected] | |
with: | |
filename: ./openalprwebhookprocessor.client/coverage/cobertura-coverage.xml | |
badge: true | |
fail_below_min: true | |
format: markdown | |
hide_branch_rate: false | |
hide_complexity: true | |
indicators: true | |
output: both | |
thresholds: '0 80' | |
- name: Add Coverage PR Comment | |
uses: marocchino/sticky-pull-request-comment@v2 | |
if: github.event_name == 'pull_request' | |
with: | |
header: Front End Coverage | |
recreate: true | |
path: code-coverage-results.md | |
windows-build-push: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@main | |
- name: Setup Buildx | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '8.x' | |
include-prerelease: true | |
- name: Build Artifact | |
run: | | |
tag=$(git describe --tags --abbrev=0) | |
release_name="OpenAlprWebHookProcessor-${tag}-windows64" | |
dotnet restore "OpenAlprWebhookProcessor.Server/OpenAlprWebhookProcessor.Server.csproj" | |
dotnet build "OpenAlprWebhookProcessor.Server/OpenAlprWebhookProcessor.Server.csproj" -c Release | |
dotnet publish "OpenAlprWebhookProcessor.Server/OpenAlprWebhookProcessor.Server.csproj" -c Release -o "$release_name" | |
tar czvf "${release_name}.tar.gz" "$release_name" | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "OpenAlprWebHookProcessor*" | |
prerelease: ${{ contains(github.ref, 'alpha') }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docker-build-push: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Setup Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Get git tag | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
- name: Push to Docker Hub | |
uses: docker/build-push-action@v2 | |
with: | |
file: ./OpenAlprWebhookProcessor.Server/Dockerfile | |
push: true | |
tags: | | |
mlapaglia/openalprwebhookprocessor:${{ steps.get_version.outputs.VERSION }} | |
${{ contains(github.ref, 'alpha') && 'mlapaglia/openalprwebhookprocessor:alpha' || 'mlapaglia/openalprwebhookprocessor:latest' }} |