Skip to content

Commit 2c6c032

Browse files
committed
ci: add cf-pages
1 parent 57b6c72 commit 2c6c032

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/cf-pages.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Deploy to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths:
8+
- "site/**"
9+
workflow_dispatch: {}
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
deployments: write
17+
defaults:
18+
run:
19+
working-directory: site
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
submodules: true # Fetch Hugo themes (true OR recursive)
24+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
25+
26+
- name: Setup Hugo
27+
uses: peaceiris/actions-hugo@v2
28+
with:
29+
hugo-version: '0.101.0'
30+
extended: true
31+
32+
- name: Build
33+
run: hugo --buildFuture --minify --environment production
34+
35+
- name: Publish
36+
uses: cloudflare/pages-action@v1
37+
with:
38+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
39+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
40+
projectName: awesome-chatgpt-api
41+
directory: site/public
42+
branch: master

site/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.hugo_build.lock
2+
public

0 commit comments

Comments
 (0)