Skip to content

Commit bc6d159

Browse files
author
mohit23x
committed
gh pages
1 parent c4ac098 commit bc6d159

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,33 @@ jobs:
3333
uses: JS-DevTools/npm-publish@v3
3434
with:
3535
token: ${{ secrets.NPM_TOKEN }}
36+
37+
deploy-example:
38+
runs-on: ubuntu-latest
39+
needs: publish
40+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Use Node.js 20.x
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: 20.x
47+
- name: Cache node_modules
48+
uses: actions/cache@v4
49+
with:
50+
path: example/node_modules
51+
key: ${{ runner.os }}-yarn-example-${{ hashFiles('example/yarn.lock') }}
52+
restore-keys: |
53+
${{ runner.os }}-yarn-example-
54+
- name: Install dependencies (example)
55+
run: cd example && yarn install --frozen-lockfile
56+
- name: Build example app
57+
run: cd example && yarn build
58+
- name: Deploy to GitHub Pages
59+
uses: peaceiris/actions-gh-pages@v4
60+
with:
61+
github_token: ${{ secrets.GITHUB_TOKEN }}
62+
publish_dir: ./example/build
63+
publish_branch: gh-pages
64+
user_name: github-actions[bot]
65+
user_email: github-actions[bot]@users.noreply.github.com

0 commit comments

Comments
 (0)