diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9756fa3b..4529cb0b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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 'action@github.com' - 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 diff --git a/mkdocs.yml b/mkdocs.yml index 27f87057..7465bc93 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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