-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.yml
44 lines (42 loc) · 1.29 KB
/
build.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
36
37
38
39
40
41
42
43
44
name: Build
on:
push:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2
- name: build
env:
GITHUB_PAT: ${{ github.token }}
REPO: "getzola/zola"
VERSION: "latest"
MATCH: "zola-.+-x86_64-unknown-linux-gnu.tar.gz$"
RENAME: "zola.tgz"
shell: bash
run: |
curl -sL --fail \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_PAT}" \
"https://api.github.com/repos/${REPO}/releases/${VERSION}" \
| jq -r ".assets | .[] | select(.name | test(\"${MATCH}\")) | .url" \
| tee asset.url
curl -sL --fail \
-H "Accept: application/octet-stream" \
-H "Authorization: Bearer ${GITHUB_PAT}" \
-o "${RENAME}" \
"$(cat asset.url)"
tar -zxvf zola.tgz
chmod +x zola
./zola build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public