From 82f5e546a3c1f200115a3ef07dbaf33c2e2bcd46 Mon Sep 17 00:00:00 2001 From: Mario Manno Date: Mon, 28 Oct 2024 11:57:59 +0100 Subject: [PATCH] Switch github action to deploy-pages --- .github/workflows/deploy.yml | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9ab769ab1..095a50f92 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,13 +6,11 @@ on: - main jobs: - deploy: + build: runs-on: ubuntu-latest steps: - - name: Checkout main docs repo - uses: actions/checkout@v4 - - name: Setup Docusaurus - uses: actions/setup-node@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 with: node-version: 20.x cache: yarn @@ -20,8 +18,26 @@ jobs: run: | yarn install --frozen-lockfile yarn build - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + - name: Upload artifacts + if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }} + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./build + path: ./build + retention-days: 10 + compression-level: 9 + deploy: + name: Publish + if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }} + runs-on: ubuntu-latest + needs: build + + environment: + name: github-pages + + permissions: + pages: write + id-token: write + + steps: + - name: Deploy to GH Pages + uses: actions/deploy-pages@v4