-
Notifications
You must be signed in to change notification settings - Fork 7
98 lines (82 loc) · 2.58 KB
/
cicd-website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI/CD Den Haag website branch
on:
push:
branches:
- www.denhaag.nl
pull_request:
branches:
- www.denhaag.nl
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Node.js version
uses: actions/[email protected]
with:
node-version: "20.11.x"
- name: yarn install
run: |
npm install -g yarn
yarn install --frozen-lockfile
- name: run linters
run: |
yarn lint:css
yarn lint:package
yarn lint:js
yarn lint:prettier
- name: build library
run: yarn build:library
- name: typecheck storybook
run: yarn typecheck:storybook
- name: build storybook
run: yarn build:storybook
- name: Publish to Chromatic
uses: chromaui/action@v10
if: github.event.pull_request.draft == false
with:
autoAcceptChanges: www.denhaag.nl
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: storybook-static
publish-npm:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/www.denhaag.nl'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_ADMIN_TOKEN }}
- name: Set up Node.js version
uses: actions/[email protected]
with:
node-version: "20.11.x"
- name: yarn install
run: |
npm install -g yarn
yarn install --frozen-lockfile
- name: build library
run: yarn build
- name: lerna version
env:
GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GIT_AUTHOR_NAME: "Den Haag website"
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }}
GIT_COMMITTER_NAME: "Den Haag website"
run: |
git push --set-upstream origin HEAD
yarn release -- --yes --preid www-denhaag-nl
- name: lerna publish
env:
NPM_TOKEN: ${{ secrets.DEN_HAAG_ADMIN_TOKEN }}
NPM_REGISTRY: "npm.pkg.github.com"
NPM_SCOPE: "@gemeente-denhaag"
run: |
npm config set "${NPM_SCOPE}:registry" "https://${NPM_REGISTRY}"
npm config set "//${NPM_REGISTRY}/:_authToken" "${NPM_TOKEN}"
npm config set access public
npm run publish -- --no-verify-access --yes
npm config delete "//${NPM_REGISTRY}/:_authToken"