From 5e8f29e60a0f62be144f27cd3d4e8548b569a36d Mon Sep 17 00:00:00 2001 From: Bersella Date: Thu, 30 Nov 2023 18:23:10 +0800 Subject: [PATCH] Build the site with tools from Alpine --- .github/workflows/publish.yaml | 36 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index aac966a..74b0a94 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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