Skip to content

Commit

Permalink
Change docs yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashankar committed Sep 13, 2024
1 parent f42c389 commit b6094a3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 47 deletions.
60 changes: 20 additions & 40 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
name: Deploy MkDocs to Next.js

name: ci
on:
push:
branches:
- main # or your default branch

- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod

- name: Set up Python
uses: actions/setup-python@v2
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
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
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
14 changes: 7 additions & 7 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
site_name: docetl docs
site_url: https://docetl.com/docs/
use_directory_urls: false
strict: true
docs_dir: docs
site_dir: public/docs
site_url: https://docetl.com/
# use_directory_urls: false
# strict: true
# docs_dir: docs
# site_dir: public/docs

extra:
docs_url: /docs
# extra:
# docs_url: /docs

repo_url: https://github.com/shreyashankar/docetl
repo_name: shreyashankar/docetl
Expand Down

0 comments on commit b6094a3

Please sign in to comment.