Skip to content

Commit b8fe077

Browse files
authored
Merge branch 'main' into blog-post-identity-sync-architecture
2 parents 0d712b9 + c14a358 commit b8fe077

File tree

16 files changed

+628
-99
lines changed

16 files changed

+628
-99
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ on:
1111
default: "main"
1212

1313
env:
14-
IMAGE_NAME: ghcr.io/developer-overheid-nl/don-site
14+
IMAGE_NAME: ghcr.io/${{ github.repository }}
1515

1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Set up Docker Buildx
21-
uses: docker/setup-buildx-action@v3
21+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
2222

2323
- name: Build image
24-
uses: docker/build-push-action@v6
24+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
2525
with:
2626
target: caddy
2727
tags: |
@@ -33,21 +33,20 @@ jobs:
3333
"PIWIK_PRO_SITE_ID=${{ secrets.PIWIK_PRO_SITE_ID }}"
3434
3535
- name: Upload artifact
36-
uses: actions/upload-artifact@v4
36+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
3737
with:
3838
name: image
3939
path: ${{ runner.temp }}/image.tar
4040
retention-days: 1
4141

4242
publish:
4343
if: |
44-
github.repository == 'developer-overheid-nl/don-site' &&
45-
(github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch')
44+
github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
4645
runs-on: ubuntu-latest
4746
needs: build
4847
steps:
4948
- name: Download artifact
50-
uses: actions/download-artifact@v4
49+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
5150
with:
5251
name: image
5352
path: ${{ runner.temp }}
@@ -57,7 +56,7 @@ jobs:
5756
docker load --input ${{ runner.temp }}/image.tar
5857
5958
- name: Login to container registry
60-
uses: docker/login-action@v3
59+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
6160
with:
6261
registry: ghcr.io
6362
username: ${{ github.actor }}

.github/workflows/check-links.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
check-links:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
11+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1212

1313
- name: Install pnpm
1414
run: npm install -g pnpm
@@ -20,7 +20,7 @@ jobs:
2020
run: pnpm run build
2121

2222
- name: Run Linkinator to check external links
23-
uses: JustinBeckwith/linkinator-action@v1
23+
uses: JustinBeckwith/linkinator-action@f62ba0c110a76effb2ee6022cc6ce4ab161085e3
2424
continue-on-error: true
2525
with:
2626
paths: "build"

.github/workflows/check-wcag.yml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
check-wcag:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1313

1414
- name: Install pnpm
1515
run: npm install -g pnpm
@@ -21,33 +21,16 @@ jobs:
2121
run: pnpm run build
2222

2323
- name: Serve Files
24-
uses: Eun/http-server-action@v1
25-
with:
26-
content-types: |
27-
{
28-
"css": "text/css",
29-
"html": "text/html",
30-
"ico": "image/x-icon",
31-
"jpeg": "image/jpeg",
32-
"jpg": "image/jpeg",
33-
"js": "text/javascript",
34-
"json": "application/json",
35-
"png": "image/png",
36-
"svg": "image/svg+xml",
37-
"txt": "text/plain",
38-
"xml": "text/xml"
39-
}
40-
port: 3000
41-
directory: build/
42-
index-files: |
43-
["index.html"]
24+
run: |
25+
npx --yes serve build/ --listen 3000 &
26+
npx --yes wait-on http://localhost:3000
4427
4528
- name: Run Axe to check for WCAG compliance
4629
run: node scripts/wcag-sitemap-check.js
4730

4831
- name: Upload WCAG report to Slack
4932
if: always()
50-
uses: slackapi/slack-github-action@v2.1.1
33+
uses: slackapi/slack-github-action@af78098f536edbc4de71162a307590698245be95
5134
with:
5235
method: files.uploadV2
5336
token: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/deploy-prod.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Deploy to Production
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
IMAGE_NAME: ghcr.io/${{ github.repository }}
11+
INFRA_REPO: ${{ vars.INFRA_REPO }}
12+
KUSTOMIZE_PATH: ${{ vars.KUSTOMIZE_PATH }}
13+
DEPLOY_ENV: prod
14+
15+
jobs:
16+
create-infra-pr:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Parse infra repository
20+
id: infra-repo
21+
run: |
22+
INFRA_REPO="${{ env.INFRA_REPO }}"
23+
24+
if [[ -z "$INFRA_REPO" || "$INFRA_REPO" != */* ]]; then
25+
echo "INFRA_REPO moet de vorm owner/repo hebben, huidige waarde: '$INFRA_REPO'" >&2
26+
exit 1
27+
fi
28+
29+
echo "owner=${INFRA_REPO%%/*}" >> "$GITHUB_OUTPUT"
30+
echo "repo=${INFRA_REPO#*/}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Genereer app token (Release proces app)
33+
id: app-token
34+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
35+
with:
36+
app-id: ${{ secrets.RELEASE_PROCES_APP_ID }}
37+
private-key: ${{ secrets.RELEASE_PROCES_APP_PRIVATE_KEY }}
38+
owner: ${{ steps.infra-repo.outputs.owner }}
39+
repositories: ${{ steps.infra-repo.outputs.repo }}
40+
41+
- name: Checkout don-infra
42+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
43+
with:
44+
repository: ${{ env.INFRA_REPO }}
45+
token: ${{ steps.app-token.outputs.token }}
46+
47+
- name: Maak release branch aan in don-infra
48+
id: branch
49+
run: |
50+
BRANCH="release/don-site-${{ github.sha }}"
51+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
52+
git checkout -b "$BRANCH"
53+
54+
- name: Update image tag in prod overlay
55+
run: |
56+
KUSTOMIZATION_FILE="${{ env.KUSTOMIZE_PATH }}${{ env.DEPLOY_ENV }}/kustomization.yaml"
57+
58+
yq e '(.images[] | select(.newName == "${{ env.IMAGE_NAME }}")).newTag = "${{ github.sha }}"' -i "$KUSTOMIZATION_FILE"
59+
60+
- name: Commit en push release branch
61+
run: |
62+
KUSTOMIZATION_FILE="${{ env.KUSTOMIZE_PATH }}${{ env.DEPLOY_ENV }}/kustomization.yaml"
63+
64+
git config user.name "${{ github.actor }}"
65+
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
66+
git add "$KUSTOMIZATION_FILE"
67+
git commit -m "release: don-site → ${{ github.sha }}
68+
69+
Commit: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
70+
git push origin "${{ steps.branch.outputs.branch }}"
71+
72+
- name: Maak PR aan in don-infra
73+
env:
74+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
75+
run: |
76+
gh pr create \
77+
--repo "${{ env.INFRA_REPO }}" \
78+
--base main \
79+
--head "${{ steps.branch.outputs.branch }}" \
80+
--title "Release: don-site → ${GITHUB_SHA::7}" \
81+
--body "## don-site productie deploy
82+
83+
**Image:** \`${{ env.IMAGE_NAME }}:${{ github.sha }}\`
84+
**Branch:** \`${{ github.ref_name }}\`
85+
**Commit:** ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}
86+
87+
Merge deze PR om de nieuwe versie naar productie te deployen."

.github/workflows/deploy-test.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Deploy to Test
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches-ignore:
7+
- main
8+
9+
env:
10+
IMAGE_NAME: ghcr.io/${{ github.repository }}
11+
INFRA_REPO: ${{ vars.INFRA_REPO }}
12+
KUSTOMIZE_PATH: ${{ vars.KUSTOMIZE_PATH }}
13+
DEPLOY_ENV: test
14+
15+
jobs:
16+
check-keyword:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
deploy: ${{ steps.check.outputs.deploy }}
20+
steps:
21+
- name: Check commit message for deploy keyword
22+
id: check
23+
env:
24+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
25+
run: |
26+
# Keyword: [deploy-test] anywhere in de commit message
27+
# Voorbeeld: "feat: nieuwe feature [deploy-test]"
28+
if echo "$COMMIT_MESSAGE" | grep -qi "\[deploy-test\]"; then
29+
echo "deploy=true" >> $GITHUB_OUTPUT
30+
echo "Deploy keyword gevonden in commit message."
31+
else
32+
echo "deploy=false" >> $GITHUB_OUTPUT
33+
echo "Geen deploy keyword gevonden, sla deploy over."
34+
fi
35+
36+
build-and-push:
37+
needs: check-keyword
38+
if: |
39+
needs.check-keyword.outputs.deploy == 'true'
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: read
43+
packages: write
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
47+
48+
- name: Set up Docker Buildx
49+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
50+
51+
- name: Login to container registry
52+
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.actor }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- name: Build and push image
59+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294
60+
with:
61+
context: .
62+
target: caddy
63+
push: true
64+
tags: |
65+
${{ env.IMAGE_NAME }}:test
66+
${{ env.IMAGE_NAME }}:${{ github.sha }}
67+
secrets: |
68+
"PIWIK_PRO_ACCOUNT_ADDRESS=${{ secrets.PIWIK_PRO_ACCOUNT_ADDRESS }}"
69+
"PIWIK_PRO_SITE_ID=${{ secrets.PIWIK_PRO_SITE_ID }}"
70+
71+
update-infra-test:
72+
needs: build-and-push
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Parse infra repository
76+
id: infra-repo
77+
run: |
78+
INFRA_REPO="${{ env.INFRA_REPO }}"
79+
80+
if [[ -z "$INFRA_REPO" || "$INFRA_REPO" != */* ]]; then
81+
echo "INFRA_REPO moet de vorm owner/repo hebben, huidige waarde: '$INFRA_REPO'" >&2
82+
exit 1
83+
fi
84+
85+
echo "owner=${INFRA_REPO%%/*}" >> "$GITHUB_OUTPUT"
86+
echo "repo=${INFRA_REPO#*/}" >> "$GITHUB_OUTPUT"
87+
88+
- name: Genereer app token (Release proces app)
89+
id: app-token
90+
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859
91+
with:
92+
app-id: ${{ secrets.RELEASE_PROCES_APP_ID }}
93+
private-key: ${{ secrets.RELEASE_PROCES_APP_PRIVATE_KEY }}
94+
owner: ${{ steps.infra-repo.outputs.owner }}
95+
repositories: ${{ steps.infra-repo.outputs.repo }}
96+
97+
- name: Checkout don-infra
98+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
99+
with:
100+
repository: ${{ env.INFRA_REPO }}
101+
token: ${{ steps.app-token.outputs.token }}
102+
103+
- name: Update image tag in test overlay
104+
run: |
105+
KUSTOMIZATION_FILE="${{ env.KUSTOMIZE_PATH }}${{ env.DEPLOY_ENV }}/kustomization.yaml"
106+
107+
yq e '(.images[] | select(.newName == "${{ env.IMAGE_NAME }}")).newTag = "${{ github.sha }}"' -i "$KUSTOMIZATION_FILE"
108+
109+
- name: Commit en push naar don-infra
110+
run: |
111+
KUSTOMIZATION_FILE="${{ env.KUSTOMIZE_PATH }}${{ env.DEPLOY_ENV }}/kustomization.yaml"
112+
113+
git config user.name "${{ github.actor }}"
114+
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
115+
git add "$KUSTOMIZATION_FILE"
116+
git commit -m "test: don-site → ${{ github.sha }}
117+
118+
Branch: ${{ github.ref_name }}
119+
Commit: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
120+
git push

.github/workflows/json-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
issues: write
1313
pull-requests: write
1414
steps:
15-
- uses: actions/checkout@v6.0.2
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1616
with:
1717
fetch-depth: 0
1818
- name: Run Super-Linter
19-
uses: super-linter/super-linter@v8.5.0
19+
uses: super-linter/super-linter@61abc07d755095a68f4987d1c2c3d1d64408f1f9
2020
env:
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2222
FILTER_REGEX_EXCLUDE: "(^|.*/)\\.vscode/|(^|.*/)tsconfig(\\..+)?\\.json$"

0 commit comments

Comments
 (0)