-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.16 KB
/
preview.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Deploy Preview
on:
pull_request:
branches:
- main # or the branch you want to base the preview on
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js 22
uses: actions/setup-node@v3
with:
node-version: '22' # Specify the version of Node.js you need
- name: Run install and export
run: |
npm install
npm run export
- name: Deploy to GitHub Pages Preview
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
publish_branch: gh-pages-preview-${{ github.event.pull_request.number }}
cname: wiki.watonomous.ca
- name: Comment on the PR with the preview link
uses: peter-evans/commit-comment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🚀 Preview of the changes is available at:
https://${{ github.repository_owner }}.github.io/${{ github.repository }}/gh-pages-preview-${{ github.event.pull_request.number }}