-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.59 KB
/
page-site.yml
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
47
48
49
50
51
52
53
54
name: generate page site
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
checks: write
contents: write
deployments: write
name: Publish to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- run: npm ci
- run: npm run docs:build
- name: Generate changelog
uses: jaywcjlove/changelog-generator@main
if: ${{ github.ref == 'refs/heads/master' }}
id: changelog
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Release
uses: jaywcjlove/create-tag-action@main
if: ${{ github.ref == 'refs/heads/master' }}
id: tag_release
with:
release: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
${{ steps.changelog.outputs.compareurl }}
${{ steps.changelog.outputs.changelog }}
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
if: steps.tag_release.outputs.successful
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: geekfun-site
directory: dist
# Optional: Enable this if you want to have GitHub Deployments triggered
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: master
environment: production