-
Notifications
You must be signed in to change notification settings - Fork 209
47 lines (39 loc) · 1.08 KB
/
deploy.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
name: 部署到 Cloudflare
on:
push:
branches:
- 'master'
paths:
- '.github/workflows/deploy.yaml'
- 'content/**'
- 'config/**'
- 'static/**'
- 'themes/**'
- 'package.json'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: DeterminateSystems/nix-installer-action@main
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Build site
run: nix run github:nixos/nixpkgs/nixos-24.11#hugo -- --minify --enableGitInfo
- name: Deploy to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_PAGES_ACCOUNT }}
command: pages deploy public --project-name=mtfwiki