diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 838de40..1a01fc6 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,37 +1,60 @@ name: docs permissions: - contents: write + contents: read on: push: - tags: - - "v*" + branches: + - main + +concurrency: + group: "pages" + cancel-in-progress: false + +env: + EM_CACHE_FOLDER: 'emsdk-cache' jobs: - docs: + build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v6 - - name: recovery tag information - run: git fetch --tags --force + - uses: actions/setup-node@v6 + with: + node-version: 'latest' + cache: 'npm' - - uses: astral-sh/setup-uv@v7 + - uses: actions/cache@v5 with: - python-version: '3.14' - enable-cache: true + path: ${{ env.EM_CACHE_FOLDER }} + key: docs-em-cache-${{ runner.os }} - - name: install dependencies - run: uv sync --locked --extra docs + - uses: pyodide/setup-emsdk@v15 + with: + actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} - - name: configure git - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: dependencies + run: npm ci - - name: build docs - run: uv run mike deploy --push --update-aliases --alias-type=redirect ${GITHUB_REF#refs/tags/} latest + - name: build + run: npm run docs - - name: set default - run: uv run mike set-default --push latest + - uses: actions/upload-pages-artifact@v3 + with: + path: .vitepress/dist + + deploy: + runs-on: ubuntu-latest + needs: build + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + permissions: + pages: write + id-token: write + + steps: + - id: deployment + uses: actions/deploy-pages@v4