Skip to content

Commit

Permalink
chore(ci): workflow definition created
Browse files Browse the repository at this point in the history
  • Loading branch information
MelvLee committed Sep 4, 2023
1 parent d2f2358 commit c29664d
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: ci

on:
push:
paths:
- src/**
- .github/workflows/ci.yml
branches:
- master
tags:
- v*-proxy

env:
DOTNET_VERSION: 6.0.x
DOTNET_SOLUTION: WOZ.sln
NODE_VERSION: 18
CONTAINER_NAME: ghcr.io/vng-realisatie/wozbevragenproxy

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore ${{ env.DOTNET_SOLUTION }}
- name: Build
run: dotnet build ${{ env.DOTNET_SOLUTION }} --configuration Release --no-restore
- name: Test
run: dotnet test ${{ env.DOTNET_SOLUTION }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Cache container images
uses: actions/[email protected]
with:
path: /var/lib/docker/
key: local-docker-directory
- name: Build container images
run: docker compose build
- uses: actions-ecosystem/action-regex-match@v2
if: always()
id: regex-match
with:
text: ${{ github.ref_name }}
regex: '^v(.*)-(.*)$'
- name: Login to GitHub Container Registry
if: always() && steps.regex-match.outputs.match != ''
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push proxy container images
if: always() && steps.regex-match.outputs.group2 == 'proxy'
run: |
docker tag ${{ env.CONTAINER_NAME }}-proxy:latest ${{ env.CONTAINER_NAME }}-proxy:${{ steps.regex-match.outputs.group1 }}
docker push ${{ env.CONTAINER_NAME }}-proxy:latest
docker push ${{ env.CONTAINER_NAME }}-proxy:${{ steps.regex-match.outputs.group1 }}

0 comments on commit c29664d

Please sign in to comment.