diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 5a628c7..3f780e9 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -1,29 +1,20 @@ -name: doc - +name: Deploy Docs to GitHub Pages on: push: branches: - main - patch-workflow - -# Prevent doc action on `main` from conflicting with others. -concurrency: - group: doc-${{ github.ref }} - cancel-in-progress: true - +permissions: + contents: write jobs: - doc: - runs-on: "ubuntu-latest" - timeout-minutes: 30 - - defaults: - run: - shell: bash -l {0} - + deploy: + runs-on: ubuntu-latest steps: - - name: Checkout the code - uses: actions/checkout@v4 - + - 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 - name: Setup mamba uses: mamba-org/setup-micromamba@v1 with: @@ -31,21 +22,16 @@ jobs: environment-name: my_env cache-environment: true cache-downloads: true - - name: Install library run: python -m pip install --no-deps . - - - name: Configure git - run: | - git config --global user.name "${GITHUB_ACTOR}" - git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - - name: Deploy the doc - run: | - echo "Get the latest version of the doc" - git fetch origin gh-pages - - echo "Build and deploy the doc on main" - mike deploy --push patch-workflow - env: - github_token: ${{ secrets.PAT }} + - uses: actions/setup-python@v5 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v4 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: mkdocs gh-deploy --force \ No newline at end of file