@@ -3,45 +3,34 @@ name: Zola on GitHub Pages
3
3
on :
4
4
push :
5
5
branches :
6
- - master
7
- - dev-docs
6
+ - main
8
7
pull_request :
9
-
8
+
10
9
jobs :
11
10
build :
12
11
runs-on : ubuntu-latest
13
- if : github.ref != 'refs/heads/master '
12
+ if : github.ref != 'refs/heads/main '
14
13
steps :
15
- - name : Checkout master
16
- uses : actions/checkout@v3.0.0
17
- - name : Build only
18
- uses : shalzz/zola-deploy-action@v0.16.1-1
14
+ - name : Checkout main
15
+ uses : actions/checkout@v4
16
+ - name : Build only
17
+ uses : shalzz/zola-deploy-action@v0.18.0
19
18
env :
20
19
BUILD_DIR : .
21
20
BUILD_ONLY : true
22
21
BUILD_FLAGS : --drafts
23
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
-
22
+ # A GitHub token is not necessary when BUILD_ONLY is true
23
+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24
+
25
25
build_and_deploy :
26
26
runs-on : ubuntu-latest
27
- if : github.ref == 'refs/heads/master '
27
+ if : github.ref == 'refs/heads/main '
28
28
steps :
29
- - name : Checkout master
30
- uses : actions/checkout@v3.0.0
29
+ - name : Checkout main
30
+ uses : actions/checkout@v4
31
31
- name : Build and deploy
32
- uses : shalzz/zola-deploy-action@v0.16.1-1
32
+ uses : shalzz/zola-deploy-action@v0.18.0
33
33
env :
34
34
BUILD_DIR : .
35
35
PAGES_BRANCH : gh-pages
36
36
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
37
- - name : Deploy developer docs
38
- working-directory : ${{github.workspace}}
39
- run : |
40
- git config user.name "GitHub Actions"
41
- git config user.email "[email protected] "
42
-
43
- git fetch origin gh-pages:gh-pages developer-docs:developer-docs
44
- git checkout gh-pages
45
- git cherry-pick developer-docs || true
46
- git remote add destination "https://${{github.actor}}:${{github.token}}@github.com/${{github.repository}}.git"
47
- git push destination gh-pages
0 commit comments