1- name : Docker Image CI
1+ name : CI
22
33on :
44 push :
@@ -14,87 +14,45 @@ permissions:
1414jobs :
1515 teammapper-backend-build :
1616 runs-on : ubuntu-latest
17- permissions :
18- contents : read
19- packages : read
2017
2118 steps :
2219 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2320
24- - name : Set up QEMU
25- uses : docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4
26-
2721 - name : Set up Docker Buildx
2822 uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4
2923
30- - name : Login to GitHub Container Registry
31- uses : docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4
32- with :
33- registry : ghcr.io
34- username : ${{ github.repository_owner }}
35- password : ${{ secrets.GITHUB_TOKEN }}
36-
37- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
38- with :
39- node-version : ' 24'
40-
41- - run : corepack enable
42- - run : corepack prepare pnpm@10.33.4 --activate
43-
44- - name : Build and export to Docker
24+ - name : Build Docker image (smoke test)
4525 uses : docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f # v7
4626 with :
4727 context : .
4828 target : production
4929 tags : |
5030 ghcr.io/b310-digital/teammapper:latest
31+ cache-from : type=gha
32+ cache-to : type=gha,mode=max
5133
5234 teammapper-backend-lint :
5335 runs-on : ubuntu-latest
5436
5537 steps :
5638 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
57-
58- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
59- with :
60- node-version : ' 24'
61-
62- - run : corepack enable
63- - run : corepack prepare pnpm@10.33.4 --activate
64-
65- - run : pnpm install --frozen-lockfile
39+ - uses : ./.github/actions/setup-pnpm
6640 - run : pnpm --filter teammapper-backend run lint
6741
6842 teammapper-frontend-lint :
6943 runs-on : ubuntu-latest
7044
7145 steps :
7246 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
73-
74- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
75- with :
76- node-version : ' 24'
77-
78- - run : corepack enable
79- - run : corepack prepare pnpm@10.33.4 --activate
80-
81- - run : pnpm install --frozen-lockfile
47+ - uses : ./.github/actions/setup-pnpm
8248 - run : pnpm --filter teammapper-frontend run lint
8349
8450 teammapper-frontend-tsc :
8551 runs-on : ubuntu-latest
8652
8753 steps :
8854 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
89-
90- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
91- with :
92- node-version : ' 24'
93-
94- - run : corepack enable
95- - run : corepack prepare pnpm@10.33.4 --activate
96-
97- - run : pnpm install --frozen-lockfile
55+ - uses : ./.github/actions/setup-pnpm
9856 - run : pnpm --filter @teammapper/mermaid-mindmap-parser run build
9957 - run : pnpm --filter teammapper-frontend run tsc
10058
@@ -103,44 +61,26 @@ jobs:
10361
10462 steps :
10563 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
106-
107- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
108- with :
109- node-version : ' 24'
110-
111- - run : corepack enable
112- - run : corepack prepare pnpm@10.33.4 --activate
113-
114- - run : pnpm install --frozen-lockfile
64+ - uses : ./.github/actions/setup-pnpm
11565 - run : pnpm --filter teammapper-backend run tsc
11666
11767 teammapper-backend-test-e2e :
11868 runs-on : ubuntu-latest
11969
12070 services :
12171 postgres :
122- image : postgres:10.8
72+ image : postgres:15-alpine
12373 env :
12474 POSTGRES_USER : teammapper-user
12575 POSTGRES_PASSWORD : teammapper-password
12676 POSTGRES_DB : teammapper-backend-test
12777 ports :
128- # Will assign a random free host port
12978 - 5432/tcp
130- # Needed because the postgres container does not provide a healthcheck
13179 options : --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
13280
13381 steps :
13482 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
135-
136- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
137- with :
138- node-version : ' 24'
139-
140- - run : corepack enable
141- - run : corepack prepare pnpm@10.33.4 --activate
142-
143- - run : pnpm install --frozen-lockfile
83+ - uses : ./.github/actions/setup-pnpm
14484 - run : pnpm --filter teammapper-backend run test
14585 env :
14686 POSTGRES_DATABASE : " teammapper-backend-test"
@@ -159,16 +99,10 @@ jobs:
15999
160100 teammapper-frontend-test :
161101 runs-on : ubuntu-latest
102+
162103 steps :
163104 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
164- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
165- with :
166- node-version : ' 24'
167-
168- - run : corepack enable
169- - run : corepack prepare pnpm@10.33.4 --activate
170-
171- - run : pnpm install --frozen-lockfile
105+ - uses : ./.github/actions/setup-pnpm
172106 - run : pnpm --filter @teammapper/mermaid-mindmap-parser run build
173107 - run : pnpm --filter teammapper-frontend run test
174108
@@ -177,15 +111,7 @@ jobs:
177111
178112 steps :
179113 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
180-
181- - uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
182- with :
183- node-version : ' 24'
184-
185- - run : corepack enable
186- - run : corepack prepare pnpm@10.33.4 --activate
187-
188- - run : pnpm install --frozen-lockfile
114+ - uses : ./.github/actions/setup-pnpm
189115 - name : pnpm audit (fail on high/critical production deps)
190116 run : pnpm audit --audit-level=high --prod
191117
@@ -200,4 +126,4 @@ jobs:
200126 uses : actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
201127 with :
202128 fail-on-severity : high
203- allow-licenses : MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, CC0-1.0, Unlicense, BlueOak-1.0.0, Zlib, CC-BY-4.0
129+ allow-licenses : MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, 0BSD, CC0-1.0, Unlicense, BlueOak-1.0.0, Zlib, CC-BY-4.0
0 commit comments