|
8 | 8 | - .github
|
9 | 9 | - README.md
|
10 | 10 | - LICENSE
|
| 11 | + workflow_dispatch: |
11 | 12 |
|
12 | 13 | jobs:
|
13 | 14 | deploy:
|
14 | 15 | runs-on: ubuntu-latest
|
15 |
| - if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" |
16 | 16 | steps:
|
17 |
| - - name: Check out current branch |
| 17 | + - name: checkout |
18 | 18 | uses: actions/checkout@v4
|
19 |
| - - name: Prepare Alpine Linux with tools (latest) |
20 |
| - uses: jirutka/setup-alpine@v1 |
21 | 19 | with:
|
22 |
| - extra-repositories: | |
23 |
| - https://dl-cdn.alpinelinux.org/alpine/edge/community |
24 |
| - packages: > |
25 |
| - bash |
26 |
| - hugo |
27 |
| - nodejs |
28 |
| - npm |
29 |
| - opencc |
30 |
| - git |
31 |
| - - name: Execute OpenCC in Alpine |
32 |
| - run: bash ./scripts/opencc.sh |
33 |
| - shell: alpine.sh {0} |
34 |
| - - name: Prepare Node.js packages in Alpine |
35 |
| - run: npm ci |
36 |
| - shell: alpine.sh {0} |
37 |
| - - name: Build the site in Alpine |
38 |
| - run: hugo --minify |
39 |
| - env: |
40 |
| - HUGO_DISABLELANGUAGES: 'en' |
41 |
| - shell: alpine.sh {0} |
42 |
| - - name: Upload to CloudFlare |
43 |
| - run: npx wrangler pages deploy public --project-name tfsci --branch main |
44 |
| - if: github.ref == 'refs/heads/main' |
45 |
| - env: |
46 |
| - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} |
47 |
| - CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} |
48 |
| - shell: bash |
| 20 | + fetch-depth: 0 |
| 21 | + submodules: true |
| 22 | + |
| 23 | + - uses: DeterminateSystems/nix-installer-action@main |
| 24 | + |
| 25 | + - name: Install Node.js |
| 26 | + uses: actions/setup-node@v4 |
| 27 | + with: |
| 28 | + node-version: '22' |
| 29 | + cache: 'npm' |
| 30 | + |
| 31 | + - name: Install npm dependencies |
| 32 | + run: npm install |
| 33 | + |
| 34 | + - name: Build site |
| 35 | + run: nix run github:nixos/nixpkgs/nixos-24.11#hugo -- --minify --enableGitInfo |
| 36 | + |
| 37 | + - name: Deploy to Cloudflare Pages |
| 38 | + id: deploy |
| 39 | + uses: cloudflare/wrangler-action@v3 |
| 40 | + with: |
| 41 | + apiToken: ${{ secrets.CF_API_TOKEN }} |
| 42 | + accountId: ${{ secrets.CF_ACCOUNT_ID }} |
| 43 | + command: pages deploy public --project-name=tfsci |
0 commit comments