From 92c977654cc6a332007a8bc9490e3fd7dc85526e Mon Sep 17 00:00:00 2001 From: James Prevett Date: Sat, 5 Oct 2024 12:04:37 -0500 Subject: [PATCH] Deploy docs from CI --- .github/workflows/ci.yaml | 53 +++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9ca0910..21da8ae 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,29 +43,38 @@ jobs: - name: Build run: npm run build:frontend - docs: - needs: ci - runs-on: ubuntu-latest - permissions: - contents: write - id-token: write - steps: - - name: Checkout - uses: actions/checkout@v3 +docs: + needs: ci + runs-on: ubuntu-latest + name: Docs build and deploy + permissions: + contents: write + id-token: write + pages: write + environment: + name: github-pages + url: ${{ steps.deploy.outputs.page_url }} + steps: + - name: Checkout + uses: actions/checkout@v3 - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: 18 + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 - - name: Install dependencies - run: npm install + - name: Install dependencies + run: npm install - - name: Build docs - run: npm run build:docs + - name: Build docs + run: npm run build:docs - - name: Deploy docs - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs + - name: Upload docs artifact + uses: actions/upload-pages-artifact@v3 + if: github.event_name != 'pull_request' + with: + path: ./docs + - name: 'Deploy docs' + id: deploy + if: github.event_name != 'pull_request' + uses: actions/deploy-pages@v4