@@ -3,35 +3,36 @@ name: Deploy to GitHub Pages
33on :
44 push :
55 branches : [new-website]
6- paths : [website/**]
6+ pull_request :
7+ branches : [new-website]
8+
9+ # Allows you to run this workflow manually from the Actions tab
10+ workflow_dispatch :
711
12+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
813jobs :
9- deploy :
10- name : Deploy to GitHub Pages
14+ publish :
1115 runs-on : ubuntu-latest
1216 steps :
13- - uses : actions/checkout@v2
14- - uses : actions/setup-node@v2
17+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
18+ - name : Check out repo
19+ uses : actions/checkout@v2
20+ # Node is required for npm
21+ - name : Set up Node
22+ uses : actions/setup-node@v2
1523 with :
16- node-version : 14.x
17- cache : npm
18- - name : Build website
19- working-directory : website
24+ node-version : " 14"
25+ # Install and build Docusaurus website
26+ - name : Build Docusaurus website
2027 run : |
21- npm ci
28+ cd website
29+ npm install
2230 npm run build
23-
24- # Popular action to deploy to GitHub Pages:
25- # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
2631 - name : Deploy to GitHub Pages
27- uses : peaceiris/actions-gh-pages@v3
32+ if : success()
33+ uses : crazy-max/ghaction-github-pages@v2
2834 with :
29- github_token : ${{ secrets.GITHUB_TOKEN }}
30- # Build output to publish to the `gh-pages` branch:
31- publish_dir : ./website/build
32- # Assign commit authorship to the official GH-Actions bot for deploys to `gh-pages` branch:
33- # https://github.com/actions/checkout/issues/13#issuecomment-724415212
34- # The GH actions bot is used by default if you didn't specify the two fields.
35- # You can swap them out with your own user credentials.
36- user_name : github-actions[bot]
37- user_email : 41898282+github-actions[bot]@users.noreply.github.com
35+ target_branch : gh-pages
36+ build_dir : website/build
37+ env :
38+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments