Skip to content

Commit 282b260

Browse files
committed
ci: use common github workflow configuration
HCRC-186. Modify the existing CI workflow configurations so that they use the city of Helsinki common workflows available in github.com/City-of-Helsinki/.github/blob/main/.github/workflows/.
1 parent 9dc5cfd commit 282b260

3 files changed

Lines changed: 23 additions & 35 deletions

File tree

.github/workflows/CI.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
1-
name: Continuous integration
1+
name: CI
22

33
on:
4-
pull_request:
54
push:
6-
branches:
7-
- main
8-
tags:
9-
- 'release-*'
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
109

1110
jobs:
12-
check:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v1
17-
with:
18-
node-version: 22
19-
- run: yarn
20-
- run: yarn lint
21-
- run: yarn test
22-
- run: yarn build
11+
common:
12+
uses: City-of-Helsinki/.github/.github/workflows/ci-node.yml@main
13+
secrets: inherit
14+
with:
15+
node-version: 22

.github/workflows/npm-publish-canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v1
1414
with:
15-
node-version: 20
15+
node-version: 22
1616
registry-url: https://registry.npmjs.org/
1717
- run: yarn
1818
- run: yarn test

.github/workflows/npm-publish.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
name: publish
1+
name: npm publish
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
tags:
6+
- 'v*.*.*' # Trigger on version tags
67

78
jobs:
8-
publish-npm-stable:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v1
13-
with:
14-
node-version: 20
15-
registry-url: https://registry.npmjs.org/
16-
- run: yarn
17-
- run: yarn test
18-
- run: yarn build
19-
- run: yarn publish-stable
20-
env:
21-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
9+
publish:
10+
uses: City-of-Helsinki/.github/.github/workflows/ci-npm-publish.yml@main
11+
with:
12+
node-version: '22'
13+
package-manager: 'yarn'
14+
install-command: 'yarn --frozen-lockfile'
15+
test-command: 'yarn test'
16+
build-command: 'yarn build'

0 commit comments

Comments
 (0)