Build the site with tools from Alpine

pull/20/head
Bersella 2023-11-30 18:23:10 +08:00
parent df6f4b2ba3
commit 5e8f29e60a
No known key found for this signature in database
GPG Key ID: B1D77BACEF56C7BD
1 changed files with 22 additions and 14 deletions

View File

@ -15,24 +15,32 @@ jobs:
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: peaceiris/actions-hugo@v2
- name: Prepare Alpine Linux with tools (latest)
uses: jirutka/setup-alpine@v1
with:
hugo-version: latest
extended: true
- run: sudo apt install -y opencc
name: Prepare OpenCC
- run: ./scripts/opencc.sh
name: Execute OpenCC
- run: npm ci
name: Prepare Node.js packages
- run: hugo --minify
name: Generate webpages for production
extra-repositories: |
https://dl-cdn.alpinelinux.org/alpine/edge/community
packages: >
bash
hugo
nodejs
npm
opencc
- 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'
- run: npx wrangler pages deploy public --project-name tfsci --branch main
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 }}
name: Upload to CloudFlare
shell: bash