-
Notifications
You must be signed in to change notification settings - Fork 46
48 lines (44 loc) · 1.4 KB
/
build.yml
File metadata and controls
48 lines (44 loc) · 1.4 KB
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
41
42
43
44
45
46
47
48
name: Zola on GitHub Pages
on:
push:
branches:
- master
- dev-docs
- dev-docs-staging
pull_request:
jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master'
steps:
- name: Checkout master
uses: actions/checkout@v3.0.0
- name: Build only
uses: shalzz/zola-deploy-action@v0.16.1-1
env:
BUILD_DIR: .
BUILD_ONLY: true
BUILD_FLAGS: --drafts
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_and_deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout master
uses: actions/checkout@v3.0.0
- name: Build and deploy
uses: shalzz/zola-deploy-action@v0.16.1-1
env:
BUILD_DIR: .
PAGES_BRANCH: gh-pages
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy developer docs
working-directory: ${{github.workspace}}
run: |
git config user.name "GitHub Actions"
git config user.email "github-actions-bot@users.noreply.github.com"
git fetch origin gh-pages:gh-pages dev-docs-staging:dev-docs-staging
git checkout gh-pages
git cherry-pick dev-docs-staging || true
git remote add destination "https://${{github.actor}}:${{github.token}}@github.com/${{github.repository}}.git"
git push destination gh-pages