Skip to content

Commit 5e5defb

Browse files
committed
ci: wip
1 parent 671dc6a commit 5e5defb

4 files changed

Lines changed: 83 additions & 31 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build Docs
2+
on:
3+
workflow_call:
4+
secrets:
5+
gh_token:
6+
required: true
7+
8+
env:
9+
GH_TOKEN: ${{ secrets.gh_token }}
10+
11+
jobs:
12+
build-docs:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up PDM
19+
uses: pdm-project/setup-pdm@v4
20+
with:
21+
python-version: "3.10"
22+
cache: true
23+
24+
- name: Install deps
25+
run: pdm install
26+
27+
- name: Build docs
28+
run: pdm docs
29+
30+
- name: Upload docs artifact
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: docs
34+
path: docs/build
35+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# .github/workflows/deploy.yml
2+
name: Deploy docs internally
3+
on:
4+
push:
5+
branches:
6+
- main
7+
jobs:
8+
build-docs:
9+
uses: ./.github/workflows/build-docs.yml
10+
secrets:
11+
gh_token: ${{ github.token }}
12+
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup PDM
19+
uses: pdm-project/setup-pdm@v4
20+
with:
21+
python-version: "3.10"
22+
cache: true
23+
24+
- name: Install dependencies
25+
run: pdm install
26+
27+
- name: Build docs
28+
run: pdm docs
29+
30+
- uses: JamesIves/github-pages-deploy-action@v4
31+
with:
32+
folder: docs/build
33+
branch: gh-pages
34+
clean-exclude: pr-preview
35+
force: false

.github/workflows/preview-docs.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ on:
99
- synchronize
1010
- closed
1111

12-
env:
13-
GH_TOKEN: ${{ github.token }}
14-
1512
jobs:
13+
build-docs:
14+
uses: ./.github/workflows/build-docs.yml
15+
secrets:
16+
gh_token: ${{ github.token }}
17+
1618
deploy-preview:
1719
runs-on: ubuntu-latest
20+
needs: build-docs
1821
steps:
1922
- uses: actions/checkout@v4
2023

Original file line numberDiff line numberDiff line change
@@ -1,36 +1,15 @@
1-
name: CI
1+
name: Release docs LIVE!
22
on:
3-
push:
4-
branches:
5-
- main
6-
pull_request:
3+
release:
74

85
env:
96
GH_TOKEN: ${{ github.token }}
107

118
jobs:
129
build-docs:
13-
runs-on: ubuntu-22.04
14-
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
18-
- name: Set up PDM
19-
uses: pdm-project/setup-pdm@v4
20-
with:
21-
python-version: "3.10"
22-
23-
- name: Install deps
24-
run: pdm install
25-
26-
- name: Build docs
27-
run: pdm docs
28-
29-
- name: Upload docs artifact
30-
uses: actions/upload-artifact@v4
31-
with:
32-
name: docs
33-
path: docs/build
10+
uses: ./.github/workflows/build-docs.yml
11+
secrets:
12+
gh_token: ${{ github.token }}
3413

3514
publish-docs:
3615
needs: build-docs
@@ -46,7 +25,7 @@ jobs:
4625
uses: actions/download-artifact@v4
4726
with:
4827
name: docs
49-
path: docs/
28+
path: docs/build
5029

5130
- name: Publish "latest" docs
5231
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
@@ -55,5 +34,5 @@ jobs:
5534
repository-name: chipflow/chipflow.github.io
5635
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
5736
branch: main
58-
folder: docs/
37+
folder: docs/build
5938
target-folder: en/latest/

0 commit comments

Comments
 (0)