docs(release): design system packages #412
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |