diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..f6ceda0 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,60 @@ +name: Publish Docs +on: + pull_request: + branches: + - main + - 1.x + types: [closed] + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PIP Dependencies + uses: actions/setup-python@v5 + with: + cache: 'pip' + - run: python -m pip install -r ./docs/requirements.txt + + - name: Build Docs + run: | + git fetch --tags + cd docs + mkdir _build + python build_docs.py + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './pages' + deploy: + needs: docs + + permissions: + contents: read + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da27d7c..043bd86 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,10 +7,6 @@ on: pull_request: workflow_dispatch: -concurrency: - group: "pages" - cancel-in-progress: false - jobs: build: strategy: @@ -44,46 +40,3 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} slug: jimtools/jwt-auth - docs: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install PIP Dependencies - uses: actions/setup-python@v5 - with: - cache: 'pip' - - run: python -m pip install -r ./docs/requirements.txt - - name: Build Docs - run: | - git fetch --tags - cd docs - mkdir _build - python build_docs.py - - name: Setup Pages - uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - path: './pages' - deploy: - needs: docs - - permissions: - contents: read - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - runs-on: ubuntu-latest - - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} -