From 35c2f317cf5e0cfe308308bdba83b282e0094b1b Mon Sep 17 00:00:00 2001 From: Jwaegebaert <38426621+Jwaegebaert@users.noreply.github.com> Date: Sun, 23 Apr 2023 20:52:26 +0200 Subject: [PATCH] Apply PR suggestions --- .github/workflows/check_pr.yml | 4 +-- .github/workflows/release.yml | 4 +-- .github/workflows/release_next.yml | 55 ++++++++++++++---------------- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index ec889d24d60..5052845fed5 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -119,9 +119,9 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install --frozen-lockfile + run: npm ci working-directory: docs - - name: Test build docs + - name: Build docs run: npm run build working-directory: docs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d15c4c94b43..b198e90ef74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,10 +87,10 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install --frozen-lockfile + run: npm ci working-directory: docs - - name: Test build docs + - name: Build docs run: npm run build working-directory: docs publish: diff --git a/.github/workflows/release_next.yml b/.github/workflows/release_next.yml index fe429feef7d..2858502fde8 100644 --- a/.github/workflows/release_next.yml +++ b/.github/workflows/release_next.yml @@ -110,7 +110,7 @@ jobs: with: name: coverage-${{ matrix.os }}-${{ matrix.nodeRun }} path: coverage.tar - test_docs: + build_docs: if: github.repository_owner == 'pnp' runs-on: ubuntu-latest @@ -121,12 +121,34 @@ jobs: node-version: 18 - name: Install dependencies - run: npm install --frozen-lockfile + run: npm ci working-directory: docs - - name: Test build docs + - name: Build docs run: npm run build working-directory: docs + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: docs/build + deploy_docs: + if: github.repository_owner == 'pnp' + needs: build_docs + + permissions: + 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@v2 publish_next: if: github.repository_owner == 'pnp' needs: [test, test_docs] @@ -169,33 +191,6 @@ jobs: with: name: build-ubuntu-latest-18 path: build.tar - deploy_docs: - if: github.repository_owner == 'pnp' - needs: publish_next - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18 - - - name: Install dependencies - run: npm install --frozen-lockfile - working-directory: docs - - - name: Test build docs - run: npm run build - working-directory: docs - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - working-directory: docs - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build - user_name: github-actions[bot] - user_email: 41898282+github-actions[bot]@users.noreply.github.com deploy_docker: if: github.repository_owner == 'pnp' needs: publish_next