GithubPages #16
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 | |
run-name: GithubPages | |
on: | |
push: | |
branches: ['main'] | |
concurrency: | |
group: 'githubpages' | |
cancel-in-progress: true | |
jobs: | |
githubpages: | |
name: Github Pages | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Install npm packages | |
run: npm ci | |
- name: Setup variables | |
run: | | |
documentationUrl=$(cat ./public/CNAME) | |
echo "DOCUMENTATION_URL=${documentationUrl}" >> $GITHUB_ENV | |
- name: Create output folder | |
run: | | |
mkdir pages | |
cp -r ./public/assets ./pages | |
cp ./public/CNAME ./pages/CNAME | |
touch ./pages/.nojekyll | |
- name: Set up documentation pages | |
run: | | |
echo "[coverage report](https://${{ env.DOCUMENTATION_URL }}/coverage/index.html)" > ./docs/generated.md | |
echo "[view the hosted Storybook page](https://${{ env.DOCUMENTATION_URL }}/storybook)" >> ./docs/generated.md | |
npm run docs:build | |
cp -r ./.vitepress/dist/. ./pages | |
- name: Create code coverage report | |
run: | | |
npm run test:coverage | |
cp -r ./coverage ./pages/coverage | |
- name: Create Storybook export | |
run: | | |
npm run storybook:build | |
cp -r ./storybook-static ./pages/storybook | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: pages |