Skip to content

Commit 7bc77d6

Browse files
committed
Add workflow to build docs to explodinglabs.com
1 parent 2fffa25 commit 7bc77d6

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ⚠️ This workflow deploys docs to explodinglabs.com
2+
# It is active only in the official repo. Forks won't trigger deployment.
3+
name: Build and Deploy MkDocs
4+
5+
on:
6+
push:
7+
branches:
8+
- main # or your main development branch
9+
10+
jobs:
11+
deploy:
12+
if: github.repository == 'explodinglabs/superstack'
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout source repo
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: 3.x
23+
24+
- name: Install dependencies
25+
run: pip install mkdocs mkdocs-material mkdocs-mermaid2-plugin
26+
27+
- name: Build MkDocs site
28+
run: mkdocs build
29+
30+
- name: Clone target repo
31+
run: |
32+
git clone https://x-access-token:${{ secrets.TARGET_REPO_PAT }}@github.com/explodinglabs/explodinglabs.com.git target-repo
33+
cp -r site/* target-repo/
34+
env:
35+
GIT_AUTHOR_NAME: GitHub Actions
36+
GIT_COMMITTER_NAME: GitHub Actions
37+
GIT_AUTHOR_EMAIL: actions@github.com
38+
GIT_COMMITTER_EMAIL: actions@github.com
39+
40+
- name: Commit and push
41+
run: |
42+
cd target-repo
43+
git add .
44+
git commit -m "Update site from docs source repo" || echo "No changes to commit"
45+
git push

0 commit comments

Comments
 (0)