Skip to content

Commit 619f3e0

Browse files
authored
Merge pull request #32 from parallelchain-io/refactor-workflows
Refactor workflows
2 parents c92a996 + af13c87 commit 619f3e0

File tree

4 files changed

+88
-56
lines changed

4 files changed

+88
-56
lines changed

.github/workflows/deploy-main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Deploy `main` branch to GitHub Pages"
2+
run-name: "Deploy `main` (sha: ${{ github.sha }}) to Pages"
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
deploy:
14+
name: Deploy `main`
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout main branch
18+
uses: actions/checkout@v3
19+
20+
- name: Install Python
21+
uses: actions/setup-python@v4
22+
with:
23+
# actions/setup-python recommends that python-version be fixed so that workflow runs are more
24+
# predictable.
25+
python-version: '3.12.7'
26+
27+
- name: Install mkdocs
28+
run: pip install mkdocs
29+
30+
- name: Install pymdown-extensions
31+
run: pip install pymdown-extensions
32+
33+
- name: Install mkdocs-material
34+
run: pip install mkdocs-material
35+
36+
# This step force-pushes the docs to the "gh-pages" branch of the parallelchain-docs repo.
37+
- name: Build and deploy documentation
38+
run: mkdocs gh-deploy --force
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Deploy PR preview to GitHub Pages
2+
run-name: "Deploy preview for PR #${{ github.event.pull_request.number }}"
3+
4+
concurrency: preview-${{ github.ref }}
5+
6+
on:
7+
workflow_dispatch:
8+
pull_request:
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
- closed
14+
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
19+
jobs:
20+
preview:
21+
name: Deploy PR preview
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Cancel previous runs
25+
uses: styfle/[email protected]
26+
27+
- name: Checkout PR source branch
28+
uses: actions/checkout@v3
29+
30+
- name: Install Python
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: "3.12.7"
34+
35+
- name: Install mkdocs
36+
run: pip install mkdocs
37+
38+
- name: Install pymdown-extensions
39+
run: pip install pymdown-extensions
40+
41+
- name: Install mkdocs-material
42+
run: pip install mkdocs-material
43+
44+
- name: Build documentation
45+
run: mkdocs build
46+
47+
- name: Deploy generated documentation
48+
uses: rossjrw/pr-preview-action@v1
49+
with:
50+
source-dir: ./site/

.github/workflows/deploy.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/pr-preview.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)