-
Notifications
You must be signed in to change notification settings - Fork 6
36 lines (32 loc) · 1.24 KB
/
publish.yml
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
on: push
name: Build and deploy GH Pages
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install zola
run: wget -q -O - "https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | sudo tar xzf - -C /usr/local/bin
env:
ZOLA_VERSION: 0.14.1
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: build and deploy
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
# Build master branch
git checkout master
sed -i 's/title = "t-rex"/title = "t-rex (dev)"/g' config.toml
zola build --base-url https://t-rex.tileserver.ch/dev
git checkout config.toml
git checkout gh-pages && rm -rf dev && mv public dev
git add --all dev
git commit -a -m "rebuild pages" || true
# Build release branch
git checkout release
zola build --base-url https://t-rex.tileserver.ch
git checkout gh-pages && cp -r public/* .
git add --all .
git commit -a -m "rebuild pages" || true
git push origin HEAD:gh-pages