-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (45 loc) · 1.25 KB
/
publish.yaml
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
name: Publish Site
on:
push:
branches:
- main
paths-ignore:
- .github
- README.md
- LICENSE
jobs:
deploy:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- uses: actions/checkout@v3
- name: Prepare Alpine Linux with tools (latest)
uses: jirutka/setup-alpine@v1
with:
extra-repositories: |
https://dl-cdn.alpinelinux.org/alpine/edge/community
packages: >
bash
hugo
nodejs
npm
opencc
git
- name: Execute OpenCC in Alpine
run: bash ./scripts/opencc.sh
shell: alpine.sh {0}
- name: Prepare Node.js packages in Alpine
run: npm ci
shell: alpine.sh {0}
- name: Build the site in Alpine
run: hugo --minify
env:
HUGO_DISABLELANGUAGES: 'en'
shell: alpine.sh {0}
- name: Upload to CloudFlare
run: npx wrangler pages deploy public --project-name tfsci --branch main
if: github.ref == 'refs/heads/main'
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
shell: bash