Skip to content

Commit d3318c6

Browse files
committed
feat: refresh portfolio and harden website release pipeline
1 parent 1bea8f2 commit d3318c6

3,696 files changed

Lines changed: 2088 additions & 1256467 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.dockerignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ logs
3333
.env.local
3434
.env.*.local
3535

36-
# Documentation (not needed in image)
36+
# Repository documentation is excluded, but application Markdown resources
37+
# are served by the website and must remain in the build context.
3738
*.md
3839
!README.md
40+
!src/main/resources/**/*.md
3941

4042
# Test files
4143
**/*.test.*

‎.github/workflows/ci.yml‎

Lines changed: 87 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,89 +2,107 @@ name: CI Pipeline
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [main, develop]
66
pull_request:
7-
branches: [ main, develop ]
7+
branches: [main, develop]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
812

913
jobs:
1014
backend-test:
1115
name: Backend Tests
12-
runs-on: ubuntu-latest
16+
runs-on: truenas-website
17+
timeout-minutes: 30
1318

1419
steps:
15-
- uses: actions/checkout@v4
16-
17-
- name: Set up JDK 21
18-
uses: actions/setup-java@v4
19-
with:
20-
java-version: '21'
21-
distribution: 'temurin'
22-
cache: maven
23-
24-
- name: Run Backend Tests
25-
run: ./mvnw test
26-
27-
- name: Upload Test Results
28-
if: always()
29-
uses: actions/upload-artifact@v4
30-
with:
31-
name: backend-test-results
32-
path: target/surefire-reports/
20+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
21+
22+
- name: Set up JDK 21
23+
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5
24+
with:
25+
java-version: '21'
26+
distribution: temurin
27+
cache: maven
28+
29+
- name: Set up Node.js 24
30+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
31+
with:
32+
node-version: '24'
33+
cache: npm
34+
cache-dependency-path: frontend/package-lock.json
35+
36+
- name: Run Backend Tests
37+
run: ./mvnw --batch-mode test
38+
39+
- name: Upload Test Results
40+
if: always()
41+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
42+
with:
43+
name: backend-test-results
44+
path: target/surefire-reports/
45+
if-no-files-found: ignore
46+
retention-days: 7
3347

3448
frontend-build:
3549
name: Frontend Build
36-
runs-on: ubuntu-latest
50+
runs-on: truenas-website
51+
timeout-minutes: 20
3752

3853
steps:
39-
- uses: actions/checkout@v4
40-
41-
- name: Set up Node.js
42-
uses: actions/setup-node@v4
43-
with:
44-
node-version: '20'
45-
cache: 'npm'
46-
cache-dependency-path: frontend/package-lock.json
47-
48-
- name: Install Dependencies
49-
working-directory: ./frontend
50-
run: npm ci
51-
52-
- name: Build Frontend
53-
working-directory: ./frontend
54-
run: npm run build
55-
56-
- name: Upload Build Artifacts
57-
uses: actions/upload-artifact@v4
58-
with:
59-
name: frontend-build
60-
path: src/main/resources/static/
54+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
55+
56+
- name: Set up Node.js 24
57+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
58+
with:
59+
node-version: '24'
60+
cache: npm
61+
cache-dependency-path: frontend/package-lock.json
62+
63+
- name: Install Dependencies
64+
working-directory: ./frontend
65+
run: npm ci
66+
67+
- name: Build Frontend
68+
working-directory: ./frontend
69+
run: npm run build
70+
71+
- name: Upload Build Artifacts
72+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
73+
with:
74+
name: frontend-build
75+
path: target/generated-resources/static/
76+
if-no-files-found: error
77+
retention-days: 7
6178

6279
docker-build:
63-
name: Docker Build Test
64-
runs-on: ubuntu-latest
80+
name: Docker Build
81+
runs-on: truenas-website
6582
needs: [backend-test, frontend-build]
83+
timeout-minutes: 40
6684

6785
steps:
68-
- uses: actions/checkout@v4
69-
70-
- name: Set up Docker Buildx
71-
uses: docker/setup-buildx-action@v3
72-
73-
- name: Build Docker Image
74-
uses: docker/build-push-action@v5
75-
with:
76-
context: .
77-
file: ./Dockerfile
78-
push: false
79-
load: true
80-
tags: website:ci-test
81-
cache-from: type=gha
82-
cache-to: type=gha,mode=max
83-
84-
- name: Test Docker Image
85-
run: |
86-
docker run -d -p 8080:8080 --name test-app website:ci-test
87-
sleep 30
88-
curl -f http://localhost:8080/api/client/info || exit 1
89-
docker stop test-app
90-
docker rm test-app
86+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
87+
88+
- name: Set up authenticated remote BuildKit
89+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
90+
with:
91+
driver: remote
92+
endpoint: tcp://buildkit:1234
93+
driver-opts: |
94+
cacert=/run/buildkit/tls/ca.pem
95+
cert=/run/buildkit/tls/client.pem
96+
key=/run/buildkit/tls/client.key
97+
98+
- name: Build and Smoke Test Runtime Image
99+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
100+
with:
101+
context: .
102+
file: ./Dockerfile
103+
target: smoke-test
104+
platforms: linux/amd64
105+
push: false
106+
cache-from: type=gha,version=2,scope=truenas-15ed4a3293d99fba
107+
cache-to: type=gha,version=2,mode=max,scope=truenas-15ed4a3293d99fba
108+
no-cache-filters: smoke-test

‎.github/workflows/deploy.yml‎

Lines changed: 71 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: Deploy to Production
22

33
on:
4-
push:
5-
branches: [ main ]
6-
workflow_dispatch:
4+
workflow_run:
5+
workflows: ["CI Pipeline"]
6+
types: [completed]
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
711

812
env:
913
REGISTRY: ghcr.io
@@ -12,42 +16,72 @@ env:
1216
jobs:
1317
build-and-push:
1418
name: Build and Push Docker Image
15-
runs-on: ubuntu-latest
19+
if: >-
20+
github.event.workflow_run.conclusion == 'success' &&
21+
github.event.workflow_run.event == 'push' &&
22+
github.event.workflow_run.head_branch == 'main' &&
23+
github.event.workflow_run.head_repository.full_name == github.repository
24+
concurrency:
25+
group: website-production-deploy
26+
cancel-in-progress: false
27+
runs-on: truenas-website
28+
timeout-minutes: 40
1629
permissions:
1730
contents: read
1831
packages: write
1932

2033
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v4
23-
24-
- name: Set up Docker Buildx
25-
uses: docker/setup-buildx-action@v3
26-
27-
- name: Log in to Container Registry
28-
uses: docker/login-action@v3
29-
with:
30-
registry: ${{ env.REGISTRY }}
31-
username: ${{ github.repository_owner }}
32-
password: ${{ secrets.GHCR_PAT }}
33-
34-
- name: Extract metadata
35-
id: meta
36-
uses: docker/metadata-action@v5
37-
with:
38-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39-
tags: |
40-
type=raw,value=latest,enable={{is_default_branch}}
41-
type=sha,prefix=main-
42-
43-
- name: Build and push Docker image
44-
uses: docker/build-push-action@v5
45-
with:
46-
context: .
47-
file: ./Dockerfile
48-
push: true
49-
tags: ${{ steps.meta.outputs.tags }}
50-
labels: ${{ steps.meta.outputs.labels }}
51-
cache-from: type=gha
52-
cache-to: type=gha,mode=max
53-
platforms: linux/amd64
34+
- name: Checkout tested main commit
35+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
36+
with:
37+
ref: ${{ github.event.workflow_run.head_sha }}
38+
fetch-depth: 1
39+
40+
- name: Confirm tested commit is current main
41+
env:
42+
TESTED_SHA: ${{ github.event.workflow_run.head_sha }}
43+
run: |
44+
set -euo pipefail
45+
test "$(git rev-parse HEAD)" = "$TESTED_SHA"
46+
git fetch --no-tags origin refs/heads/main:refs/remotes/origin/main
47+
test "$(git rev-parse refs/remotes/origin/main)" = "$TESTED_SHA"
48+
49+
- name: Set up authenticated remote BuildKit
50+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
51+
with:
52+
driver: remote
53+
endpoint: tcp://buildkit:1234
54+
driver-opts: |
55+
cacert=/run/buildkit/tls/ca.pem
56+
cert=/run/buildkit/tls/client.pem
57+
key=/run/buildkit/tls/client.key
58+
59+
- name: Log in to Container Registry
60+
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
61+
with:
62+
registry: ${{ env.REGISTRY }}
63+
username: ${{ github.repository_owner }}
64+
password: ${{ secrets.GHCR_PAT }}
65+
66+
- name: Extract metadata
67+
id: meta
68+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
69+
with:
70+
context: git
71+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
72+
tags: |
73+
type=raw,value=latest
74+
type=sha,prefix=main-
75+
76+
- name: Build and push Docker image
77+
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
78+
with:
79+
context: .
80+
file: ./Dockerfile
81+
target: runtime
82+
push: true
83+
tags: ${{ steps.meta.outputs.tags }}
84+
labels: ${{ steps.meta.outputs.labels }}
85+
cache-from: type=gha,version=2,scope=truenas-15ed4a3293d99fba
86+
cache-to: type=gha,version=2,mode=max,scope=truenas-15ed4a3293d99fba
87+
platforms: linux/amd64

‎.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ build/
3434

3535
### Node ###
3636
node_modules/
37+
src/main/resources/static/
38+
output/playwright/
39+
.playwright-cli/
3740
npm-debug.log*
3841
yarn-debug.log*
3942
yarn-error.log*
@@ -45,6 +48,9 @@ yarn-error.log*
4548
.env.*.local
4649
*.env
4750

51+
### Local private-project inventory ###
52+
/docs/missing-projects-2026-09-28.md
53+
4854
### OS ###
4955
.DS_Store
5056
Thumbs.db
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
wrapperVersion=3.3.4
22
distributionType=only-script
3-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip

‎.nvmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

0 commit comments

Comments
 (0)