diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc589c18..7823562c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,10 +5,16 @@ on: push: branches: - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: build-and-deploy: @@ -36,17 +42,24 @@ jobs: DEPLOY_PRIME_URL: https://rohit-gohri.github.io/ DEPLOY_BASE_URL: /redocusaurus/ - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@4.1.3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - folder: website/build - clean: true # Automatically remove deleted files from the deploy branch - git-config-email: drone@rohit.page - git-config-name: Drone User + path: website/build if: ${{ github.event_name == 'push' }} + deploy-pages: + if: ${{ github.event_name == 'push' }} + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build-and-deploy + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + publish-test: runs-on: ubuntu-latest if: ${{ github.event_name != 'push' && github.head_ref != 'changeset-release/main' }} @@ -85,7 +98,7 @@ jobs: - name: Add comment if: ${{ env.publish == 'yes' }} - uses: thollander/actions-comment-pull-request@v1 + uses: thollander/actions-comment-pull-request@v2 with: message: | This pull request is automatically built and it is testable by installing [redocusaurus@v${{ env.package_version }}](https://www.npmjs.com/package/redocusaurus/v/${{ env.package_version }}). diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e724765f..82d139c8 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -33,7 +33,7 @@ jobs: run: sleep 60 - name: Wait for Vercel Preview - uses: patrickedqvist/wait-for-vercel-preview@v1.2.0 + uses: patrickedqvist/wait-for-vercel-preview@v1.3.1 id: vercel-preview with: token: ${{ secrets.GITHUB_TOKEN }}