forked from openshift/hypershift
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (61 loc) · 1.75 KB
/
docs-preview.yaml
File metadata and controls
65 lines (61 loc) · 1.75 KB
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: Docs Preview
on:
pull_request_target:
branches: [main]
paths:
- 'docs/**'
permissions:
contents: read
deployments: write
jobs:
build:
name: Build Docs
runs-on: arc-runner-set
timeout-minutes: 10
continue-on-error: true
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-python@v5
with:
python-version: '3.x'
env:
PIP_CACHE_DIR: ${{ runner.temp }}/.pip-cache
- run: pip install -r docs/requirements.txt
env:
PIP_CACHE_DIR: ${{ runner.temp }}/.pip-cache
- name: Build documentation
run: mkdocs build --strict
working-directory: docs
- uses: actions/upload-artifact@v4
with:
name: docs-site
path: docs/site
deploy:
name: Deploy Preview
needs: build
runs-on: arc-runner-set
timeout-minutes: 5
continue-on-error: true
environment:
name: docs-preview
url: https://pr-${{ github.event.pull_request.number }}.hypershift.pages.dev
steps:
- uses: actions/download-artifact@v4
with:
name: docs-site
path: site
- uses: actions/setup-node@v4
with:
node-version: '20'
env:
npm_config_cache: ${{ runner.temp }}/.npm
- name: Deploy to Cloudflare Pages
env:
npm_config_cache: ${{ runner.temp }}/.npm
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site --project-name=hypershift --branch=pr-${{ github.event.pull_request.number }} --commit-dirty=true