Skip to content

Merge pull request #11 from BRP-API/chore/sync-met-source-repo_66a97df #14

Merge pull request #11 from BRP-API/chore/sync-met-source-repo_66a97df

Merge pull request #11 from BRP-API/chore/sync-met-source-repo_66a97df #14

Workflow file for this run

name: continuous integration
on:
push:
paths:
- features/**
- .github/workflows/ci.yml
- .docker/historie-data-service.yml
workflow_dispatch:
env:
NODE_VERSION: '20'
DATA_SERVICE_DOCKER_FILE_PATH: .docker/historie-data-service.yml
DATA_SERVICE_CONTAINER_IMAGE: haalcentraal.azurecr.io/gba-historie-api
APP_CONTAINER_IMAGE: ghcr.io/brp-api/historie-data-service
jobs:
continuous-integration:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Haal build run identifier uit Docker manifest
id: build-run-id
uses: ./.github/actions/haal-build-run-identifier-uit-docker-manifest
with:
path-docker-manifest: ${{ env.DATA_SERVICE_DOCKER_FILE_PATH }}
- name: Haal versie uit Docker manifest
id: app-version
uses: ./.github/actions/haal-versie-uit-docker-manifest
with:
path-docker-manifest: ${{ env.DATA_SERVICE_DOCKER_FILE_PATH }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Login to P5 Container Registry
uses: docker/[email protected]
with:
registry: haalcentraal.azurecr.io
username: ${{ secrets.P5_CR_USER }}
password: ${{ secrets.P5_CR_PWD }}
- name: Set run permissions on script folder
uses: ./.github/actions/zet-run-bash-scripts-permission
with:
path-bash-file-or-folder: ./scripts/*
- name: Start containers
run: |
./scripts/containers-start.sh ci
- name: Wait for DB restart
run: sleep 5s
shell: bash
- name: Validate functional specs
run: |
./scripts/specs-verify.sh
- name: Stop containers
if: always()
run: |
./scripts/containers-stop.sh ci
- name: Genereer test rapportage
if: always()
run: |
node ./scripts/generate-cucumber-reports.js ${{ steps.app-version.outputs.version }} ${{ steps.build-run-id.outputs.build-run }} ${{ github.ref_name }}
- name: Upload test rapportage
if: always()
uses: actions/upload-artifact@v4
with:
name: Reports
path: test-reports
- name: Push test rapportage naar brp-api.github.io repo
if: always()
uses: tech-thinker/push-to-repo@main
env:
API_TOKEN_GITHUB: ${{ secrets.GIT_PAT_TOKEN }}
with:
source-directory: test-reports/cucumber-js/reports
destination-repository-name: brp-api.github.io
destination-github-username: BRP-API
target-branch: test-reports/historie
commit-message: "test rapporten van build: ${{ steps.build-run-id.outputs.build-run }}"
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag & push app container images naar registry
run: |
docker tag ${{ env.DATA_SERVICE_CONTAINER_IMAGE }}:${{ steps.app-version.outputs.version }}-${{ steps.build-run-id.outputs.build-run }} ${{ env.APP_CONTAINER_IMAGE }}:${{ steps.app-version.outputs.version }}-${{ steps.build-run-id.outputs.build-run }}
docker tag ${{ env.DATA_SERVICE_CONTAINER_IMAGE }}:${{ steps.app-version.outputs.version }}-${{ steps.build-run-id.outputs.build-run }} ${{ env.APP_CONTAINER_IMAGE }}:latest
docker push ${{ env.APP_CONTAINER_IMAGE }}:latest
docker push ${{ env.APP_CONTAINER_IMAGE }}:${{ steps.app-version.outputs.version }}-${{ steps.build-run-id.outputs.build-run }}