|
1 | | -# name: Release with Changelog, Build Demo, Deploy to Github Pages, Publish to NPM |
2 | | -# # 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 |
3 | | -# permissions: |
4 | | -# contents: write |
5 | | -# on: |
6 | | -# push: |
7 | | -# tags: |
8 | | -# - "v*" |
9 | | - |
10 | | -# jobs: |
11 | | -# build: |
12 | | -# runs-on: ubuntu-latest |
13 | | - |
14 | | -# steps: |
15 | | -# - name: Checkout Repository |
16 | | -# uses: actions/checkout@v4 |
17 | | -# with: |
18 | | -# fetch-depth: 0 |
19 | | - |
20 | | -# - name: Set up Node.js |
21 | | -# uses: actions/setup-node@v4 |
22 | | -# with: |
23 | | -# node-version: "20.x" |
24 | | -# registry-url: "https://registry.npmjs.org" |
25 | | - |
26 | | -# - name: Install |
27 | | -# run: npm install |
28 | | - |
29 | | -# - name: Release with Changelog |
30 | | -# run: npx changelogithub # or [email protected] if ensure the stable result |
31 | | -# continue-on-error: true # failed when only tag pushed |
32 | | -# env: |
33 | | -# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
34 | | - |
35 | | -# - name: Build Demo |
36 | | -# run: npm run build:web |
37 | | - |
38 | | -# - name: Extra Files |
39 | | -# run: | |
40 | | -# # Switch to the generated directory |
41 | | -# cd dist |
42 | | - |
43 | | -# # Set custom domain for GitHub Pages |
44 | | -# # echo "youdomain.com" > CNAME |
45 | | - |
46 | | -# # Required to bypass Jekyll on GitHub Pages |
47 | | -# echo "" > .nojekyll |
48 | | - |
49 | | -# - name: Deploy |
50 | | -# uses: JamesIves/github-pages-deploy-action@v4 |
51 | | -# with: |
52 | | -# single-commit: true |
53 | | -# branch: gh-pages |
54 | | -# clean: true |
55 | | -# folder: dist |
56 | | -# - name: Remove Dist |
57 | | -# run: rm -rf dist |
58 | | -# - name: Build Library |
59 | | -# run: npm run build |
60 | | -# - run: rm -rf node_modules && npm ci |
61 | | -# - run: npm publish |
62 | | -# env: |
63 | | -# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 1 | +name: Release with Changelog, Build Docs, Deploy to Github Pages, Publish to NPM |
| 2 | +# 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 |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | +on: |
| 6 | + push: |
| 7 | + tags: |
| 8 | + - "v*" |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout Repository |
| 16 | + uses: actions/checkout@v4 |
| 17 | + with: |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - name: Set up Node.js |
| 21 | + uses: actions/setup-node@v4 |
| 22 | + with: |
| 23 | + node-version: "20.x" |
| 24 | + registry-url: "https://registry.npmjs.org" |
| 25 | + |
| 26 | + - name: Install |
| 27 | + run: npm install |
| 28 | + |
| 29 | + - name: Release with Changelog |
| 30 | + run: npx changelogithub # or [email protected] if ensure the stable result |
| 31 | + continue-on-error: true # failed when only tag pushed |
| 32 | + env: |
| 33 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 34 | + |
| 35 | + - name: Build Demo |
| 36 | + run: npm run build:web |
| 37 | + - name: Build Docs |
| 38 | + run: npm run docs:build |
| 39 | + |
| 40 | + - name: Extra Files |
| 41 | + run: | |
| 42 | + # Switch to the generated directory |
| 43 | + cd docs/.vitepress/dist |
| 44 | +
|
| 45 | + # cp demo to here |
| 46 | + cp ../../../dist v1-demo-windowed |
| 47 | +
|
| 48 | + # Set custom domain for GitHub Pages |
| 49 | + echo "he-tree-react.phphe.com" > CNAME |
| 50 | +
|
| 51 | + # Required to bypass Jekyll on GitHub Pages |
| 52 | + echo "" > .nojekyll |
| 53 | +
|
| 54 | + - name: Deploy |
| 55 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 56 | + with: |
| 57 | + single-commit: true |
| 58 | + branch: gh-pages |
| 59 | + clean: true |
| 60 | + folder: dist |
| 61 | + - name: Remove Dist |
| 62 | + run: rm -rf dist |
| 63 | + - name: Build Library |
| 64 | + run: npm run build |
| 65 | + - run: rm -rf node_modules && npm ci |
| 66 | + - run: npm publish |
| 67 | + env: |
| 68 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments