-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (51 loc) · 1.43 KB
/
build-site.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Build and Deploy Site
on:
workflow_dispatch: # Enable manual generation
pull_request:
push:
branches:
- "main"
paths:
- "!chart/**"
- "!scripts/**"
- "content/**"
- "theme/**"
- "mkdocs.yaml"
- "requirements.txt"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-docs
cancel-in-progress: true
jobs:
build_and_deploy_hugo_site:
runs-on: ubuntu-latest
name: Build and Deploy Static site
steps:
- name: Checkout repo on source_branch
uses: actions/checkout@v4
with:
fetch-depth: "0"
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: 'pip'
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Dependencies
run: pip install -r requirements.txt
- name: Build
run: mkdocs build
- name: Publish to Cloudflare Pages
id: deploy
uses: cloudflare/pages-action@v1
if: ${{ github.actor != 'dependabot[bot]' }}
with:
apiToken: ${{ secrets.CLOUDFLARE_API_KEY }}
accountId: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
projectName: ${{secrets.CLOUDFLARE_PROJECT_NAME}}
directory: "./site/"
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'