Skip to content

Commit 2458001

Browse files
committed
ci: wip
1 parent 671dc6a commit 2458001

File tree

4 files changed

+82
-31
lines changed

4 files changed

+82
-31
lines changed

.github/workflows/build-docs.yml

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

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,14 @@
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: inherit
3412

3513
publish-docs:
3614
needs: build-docs
@@ -46,7 +24,7 @@ jobs:
4624
uses: actions/download-artifact@v4
4725
with:
4826
name: docs
49-
path: docs/
27+
path: docs/build
5028

5129
- name: Publish "latest" docs
5230
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
@@ -55,5 +33,5 @@ jobs:
5533
repository-name: chipflow/chipflow.github.io
5634
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
5735
branch: main
58-
folder: docs/
36+
folder: docs/build
5937
target-folder: en/latest/

0 commit comments

Comments
 (0)