diff --git a/.github/workflows/npm-publish-pages.yml b/.github/workflows/npm-publish-pages.yml index 7a15dd7ac..88e7081a1 100644 --- a/.github/workflows/npm-publish-pages.yml +++ b/.github/workflows/npm-publish-pages.yml @@ -20,20 +20,34 @@ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created # For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages -name: Node.js Publish SonataFlow Docs +name: Publish to GitHub Pages on: push: branches: - main - 1.* + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: write + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false jobs: build: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest strategy: @@ -43,12 +57,12 @@ jobs: steps: - name: Checkout main branch - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -63,8 +77,14 @@ jobs: - name: Copy latest to numbered version run: python scripts/copy-latest.py - - name: Publish to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: build/site + path: build/site + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/sw-docs-pr.yml b/.github/workflows/sw-docs-pr.yml index 0cbdc45cd..c541ad48d 100644 --- a/.github/workflows/sw-docs-pr.yml +++ b/.github/workflows/sw-docs-pr.yml @@ -33,8 +33,8 @@ jobs: name: "Building SonataFlow Docs with Antora" runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "16" - run: export DOCSEARCH_ENABLED=true