-
Notifications
You must be signed in to change notification settings - Fork 121
49 lines (42 loc) · 1.44 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
44
45
46
47
48
49
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 --verbose
- 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
echo "Removing existing docs directory..."
rm -rf next-repo/public/docs
echo "Creating new docs directory..."
mkdir -p next-repo/public/docs
echo "Copying MkDocs site to Next.js repo..."
cp -rv public/docs/* next-repo/public/docs/
cd next-repo
echo "Contents of public/docs directory:"
ls -R public/docs
git add .
git status
git commit -m "Update docs" || echo "No changes to commit"
git push