-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (39 loc) · 1.19 KB
/
pages-deployment.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
---
on:
push:
workflow_dispatch:
jobs:
deploy:
permissions:
contents: read
deployments: write
runs-on: ubuntu-latest
name: Deploy to Cloudflare Pages
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
submodules: true
- name: Install Python and just
uses: opensafely-core/setup-action@v1
with:
install-just: true
python-version: '3.11'
- name: Build site
env:
AccessToken: ${{ secrets.GITHUB_TOKEN }}
MKDOCS_SITE_URL: https://docs.opensafely.org
MKDOCS_MULTIREPO_CLEANUP: true
EHRQL_BRANCH: main
run: just build
- name: Add a version file
run: echo ${{ github.sha }} > site/version.html
- name: Publish
if: ${{ github.actor != 'dependabot[bot]' }}
uses: cloudflare/pages-action@f0a1cd58cd66095dee69bfa18fa5efd1dde93bca # v1.5.0
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_DIRECT_UPLOAD_API_TOKEN }}
directory: "site"
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
projectName: "opensafely-docs"