-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (55 loc) · 1.57 KB
/
cf-pages.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
55
56
57
58
59
60
61
62
63
64
65
name: Cloudflare Pages
on:
push:
branches:
#- main
- labs/mkdocs-material
env:
CF_ACCOUNT_ID: 33e6189a4a87f1923e71af8da171e2ed
PAGES_PROJECT_NAME: recaptime-dev
PYTHON_VERSION: 3.13
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Deploy on main branch
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python runtime
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Set the date environmental variable
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: Set up build cache
uses: actions/cache@v3
id: cache
with:
key: buildkit-${{ env.cache_id }}
path: .cache
restore-keys: |
buildkit-
- name: Install dependencies
run: |
sudo apt-get install pngquant
pip install --user pipenv
- name: Install Python dependencies
run: pipenv install
- name: Deploy documentation
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
PYTHONPATH: .
run: |
pipenv run build --clean
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_BOT_API_TOKEN }}
accountId: ${{ env.CF_ACCOUNT_ID }}
projectName: ${{ env.PAGES_PROJECT_NAME}}
directory: public
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main