Skip to content

Commit f664414

Browse files
committed
[updated the CI to the latest and also fixed some bugs
1 parent 99856cc commit f664414

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

.github/workflows/build.yml

+14-25
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,34 @@ name: Zola on GitHub Pages
33
on:
44
push:
55
branches:
6-
- master
7-
- dev-docs
6+
- main
87
pull_request:
9-
8+
109
jobs:
1110
build:
1211
runs-on: ubuntu-latest
13-
if: github.ref != 'refs/heads/master'
12+
if: github.ref != 'refs/heads/main'
1413
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
1918
env:
2019
BUILD_DIR: .
2120
BUILD_ONLY: true
2221
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+
2525
build_and_deploy:
2626
runs-on: ubuntu-latest
27-
if: github.ref == 'refs/heads/master'
27+
if: github.ref == 'refs/heads/main'
2828
steps:
29-
- name: Checkout master
30-
uses: actions/checkout@v3.0.0
29+
- name: Checkout main
30+
uses: actions/checkout@v4
3131
- name: Build and deploy
32-
uses: shalzz/zola-deploy-action@v0.16.1-1
32+
uses: shalzz/zola-deploy-action@v0.18.0
3333
env:
3434
BUILD_DIR: .
3535
PAGES_BRANCH: gh-pages
3636
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

Comments
 (0)