Merge pull request #1439 from City-of-Helsinki/release-4.0.0 #747
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: github pages | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Read .nvmrc | |
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
id: nvmrc | |
- name: setup node ${{ steps.nvmrc.outputs.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '${{ steps.nvmrc.outputs.NODE_VERSION }}' | |
registry-url: 'https://registry.npmjs.org' | |
- name: install dependencies | |
run: yarn | |
- name: build design tokens package | |
run: yarn build | |
working-directory: ./packages/design-tokens | |
- name: build core package | |
run: yarn build | |
working-directory: ./packages/core | |
- name: build react package | |
run: yarn build | |
working-directory: ./packages/react | |
- name: build hds-js package | |
run: yarn build:hds-js | |
working-directory: ./packages/react | |
- name: build documentation site | |
run: yarn build | |
working-directory: ./site | |
- name: Copy CNAME file | |
run: cp CNAME ./site/public/ | |
- name: build core storybook | |
run: yarn build-storybook | |
working-directory: ./packages/core | |
- name: move core storybook under site | |
run: mkdir ./site/public/storybook && mv ./packages/core/storybook-static $_/core | |
- name: build react storybook | |
run: yarn build-storybook | |
working-directory: ./packages/react | |
- name: move react storybook under site | |
run: mv ./packages/react/storybook-static ./site/public/storybook/react | |
- name: move v1 docz site under v1 | |
run: cp -R ./deprecated/v1/docz-site ./site/public/v1 | |
- name: move v1 storybooks under v1 | |
run: cp -R ./deprecated/v1/storybook ./site/public/v1/storybook | |
- name: release npm packages | |
run: yarn release | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Deploy | |
env: | |
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
PUBLISH_BRANCH: gh-pages | |
PUBLISH_DIR: ./site/public | |
SCRIPT_MODE: true | |
run: | | |
wget https://raw.githubusercontent.com/peaceiris/actions-gh-pages/v2.5.0/entrypoint.sh | |
bash ./entrypoint.sh | |
# with: | |
# keepFiles: true |