Switch github action to deploy-pages

This commit is contained in:
Mario Manno 2024-10-28 11:57:59 +01:00
parent 9e36ff0554
commit 82f5e546a3
1 changed files with 25 additions and 9 deletions

View File

@ -6,13 +6,11 @@ on:
- main - main
jobs: jobs:
deploy: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout main docs repo - uses: actions/checkout@v4
uses: actions/checkout@v4 - uses: actions/setup-node@v3
- name: Setup Docusaurus
uses: actions/setup-node@v3
with: with:
node-version: 20.x node-version: 20.x
cache: yarn cache: yarn
@ -20,8 +18,26 @@ jobs:
run: | run: |
yarn install --frozen-lockfile yarn install --frozen-lockfile
yarn build yarn build
- name: Deploy to GitHub Pages - name: Upload artifacts
uses: peaceiris/actions-gh-pages@v3 if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }}
uses: actions/upload-pages-artifact@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} path: ./build
publish_dir: ./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