-
Notifications
You must be signed in to change notification settings - Fork 123
43 lines (36 loc) · 1.17 KB
/
docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Deploy MkDocs to Next.js
on:
push:
branches:
- main # or your default branch
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: make install
- name: Build MkDocs site
run: poetry run mkdocs build
- name: Deploy to Next.js repo
env:
NEXT_REPO_TOKEN: ${{ secrets.NEXT_REPO_TOKEN }}
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git clone https://x-access-token:${NEXT_REPO_TOKEN}@github.com/shreyashankar/docetl-website.git next-repo
rm -rf next-repo/public/docs
mkdir -p next-repo/public/docs
cp -r site/* next-repo/public/docs/
cd next-repo
git add .
git commit -m "Update docs" || echo "No changes to commit"
git push