Skip to content

Commit 123b554

Browse files
authored
Use GitHub Pages (#33)
* Use pages * Adaptation for history feature
1 parent ab2f200 commit 123b554

File tree

5 files changed

+64
-46
lines changed

5 files changed

+64
-46
lines changed

.github/workflows/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/deploy-dev.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
name: Deploy develop
1+
name: Deploy PR preview
22

33
on:
44
pull_request:
55
workflow_dispatch:
66

77
jobs:
88
deploy:
9-
name: Deploy
9+
name: Deploy pages
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Fetch latest code
1313
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1416
- name: Setup Python
1517
uses: actions/setup-python@v5
1618
with:

.github/workflows/deploy-prd.yml

Lines changed: 48 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
1-
name: Deploy production
2-
3-
on:
4-
push:
5-
tags:
6-
- 'v*'
7-
8-
jobs:
9-
deploy:
10-
name: Deploy pages
11-
runs-on: ubuntu-latest
12-
steps:
13-
- name: Fetch latest code
14-
uses: actions/checkout@v4
15-
- name: Setup Python
16-
uses: actions/setup-python@v5
17-
with:
18-
python-version: "3.12"
19-
- name: Build pages
20-
run: |
21-
pip3 install poetry
22-
poetry run poetry install --no-root
23-
poetry run mkdocs build
24-
- name: Setup Vercel environment
25-
uses: actions/checkout@v4
26-
with:
27-
repository: darwinia-network/devops
28-
path: .github
29-
- name: Deploy to Vercel
30-
uses: ./.github/actions/smart-vercel
31-
with:
32-
vercel_token: ${{ secrets.VERCEL_TOKEN }}
33-
vercel_group: itering
34-
preview_output: true
35-
project_name: darwinia-docs
36-
dist_path: site
37-
prod_mode: true
38-
script_run: false
39-
enable_cache: true
40-
enable_notify_slack: true
41-
slack_channel: darwinia-document
42-
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
1+
name: Deploy production with GitHub Pages
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
deploy:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Fetch latest code
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.12"
35+
- name: Build pages
36+
run: |
37+
pip3 install poetry
38+
poetry run poetry install --no-root
39+
poetry run mkdocs build
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v4
42+
- name: Upload artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: "site"
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

.github/workflows/deploy-stg.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy staging
1+
name: Deploy staging preview
22

33
on:
44
push:
@@ -11,6 +11,8 @@ jobs:
1111
steps:
1212
- name: Fetch latest code
1313
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1416
- name: Setup Python
1517
uses: actions/setup-python@v5
1618
with:

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# System
2+
.DS_Store
3+
4+
# Integrated Development Environment
5+
.idea
6+
.vscode
7+
8+
# Cache
9+
site

0 commit comments

Comments
 (0)