Workflow file for this run
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: Release with Changelog, Build Docs, Deploy to Github Pages, Publish to NPM | |
# concat workflows because it is not easy to run trigger multiple. https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow | |
permissions: | |
contents: write | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install | |
run: npm install | |
- name: Release with Changelog | |
run: npx changelogithub # or [email protected] if ensure the stable result | |
continue-on-error: true # failed when only tag pushed | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Build Demo | |
run: npm run build:web | |
- name: Build Docs | |
run: npm run docs:build | |
- name: Extra Files | |
run: | | |
# Switch to the generated directory | |
cd docs/.vitepress/dist | |
# cp demo to here | |
cp -r ../../../dist v1-demo-windowed | |
# Set custom domain for GitHub Pages | |
echo "he-tree-react.phphe.com" > CNAME | |
# Required to bypass Jekyll on GitHub Pages | |
echo "" > .nojekyll | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
single-commit: true | |
branch: gh-pages | |
clean: true | |
folder: docs/.vitepress/dist | |
- name: Remove Dist | |
run: rm -rf dist | |
- name: Build Library | |
run: npm run build | |
- run: rm -rf node_modules && npm ci | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |