@@ -3,20 +3,19 @@ name: Deploy to GitHub Pages
3
3
on :
4
4
push :
5
5
branches :
6
- - master
6
+ - main
7
7
# Review gh actions docs if you want to further define triggers, paths, etc
8
8
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
9
9
10
- permissions :
11
- contents : write
12
-
13
10
jobs :
14
- deploy :
15
- name : Deploy to GitHub Pages
11
+ build :
12
+ name : Build Docusaurus
16
13
runs-on : ubuntu-latest
17
14
steps :
18
- - uses : actions/checkout@v3
19
- - uses : actions/setup-node@v3
15
+ - uses : actions/checkout@v4
16
+ with :
17
+ fetch-depth : 0
18
+ - uses : actions/setup-node@v4
20
19
with :
21
20
node-version : 18
22
21
cache : yarn
@@ -26,19 +25,27 @@ jobs:
26
25
- name : Build website
27
26
run : yarn build
28
27
29
- # Popular action to deploy to GitHub Pages:
30
- # Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
31
- - name : Deploy to GitHub Pages
32
- uses : peaceiris/actions-gh-pages@v3
28
+ - name : Upload Build Artifact
29
+ uses : actions/upload-pages-artifact@v3
33
30
with :
34
- cname : learn-python.computenepal.com
35
- github_token : ${{ secrets.GITHUB_TOKEN }}
36
- # Build output to publish to the `gh-pages` branch:
37
- publish_dir : ./build
38
- # The following lines assign commit authorship to the official
39
- # GH-Actions bot for deploys to `gh-pages` branch:
40
- # https://github.com/actions/checkout/issues/13#issuecomment-724415212
41
- # The GH actions bot is used by default if you didn't specify the two fields.
42
- # You can swap them out with your own user credentials.
43
- user_name : github-actions[bot]
44
- user_email : 41898282+github-actions[bot]@users.noreply.github.com
31
+ path : build
32
+
33
+ deploy :
34
+ name : Deploy to GitHub Pages
35
+ needs : build
36
+
37
+ # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
38
+ permissions :
39
+ pages : write # to deploy to Pages
40
+ id-token : write # to verify the deployment originates from an appropriate source
41
+
42
+ # Deploy to the github-pages environment
43
+ environment :
44
+ name : github-pages
45
+ url : ${{ steps.deployment.outputs.page_url }}
46
+
47
+ runs-on : ubuntu-latest
48
+ steps :
49
+ - name : Deploy to GitHub Pages
50
+ id : deployment
51
+ uses : actions/deploy-pages@v4
0 commit comments