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]')" if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - name: Prepare Alpine Linux with tools (latest)
- uses: peaceiris/actions-hugo@v2 uses: jirutka/setup-alpine@v1
with: with:
hugo-version: latest extra-repositories: |
extended: true https://dl-cdn.alpinelinux.org/alpine/edge/community
- run: sudo apt install -y opencc packages: >
name: Prepare OpenCC bash
- run: ./scripts/opencc.sh hugo
name: Execute OpenCC nodejs
- run: npm ci npm
name: Prepare Node.js packages opencc
- run: hugo --minify - name: Execute OpenCC in Alpine
name: Generate webpages for production 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: env:
HUGO_DISABLELANGUAGES: 'en' 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' if: github.ref == 'refs/heads/main'
env: env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
name: Upload to CloudFlare shell: bash