Skip to content

Commit

Permalink
Switch to github native actions for gh-pages (#177)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
dereknola authored Mar 20, 2024
1 parent 1136621 commit f63d0cd
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ on:
required: false
default: 'main'
type: string

permissions:
contents: read

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main docs repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.dev_branch }}

Expand All @@ -42,8 +46,27 @@ jobs:
sed -i 's/baseUrl: '\''\//baseUrl: '\''\/${{ github.event.repository.name }}/' docusaurus.config.js
yarn build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Create build artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
path: ./build

# Seperate the deploy job to isolate write permissions
deploy:
runs-on: ubuntu-latest
needs: build

# This is required to avoid https://github.com/actions/deploy-pages/issues/271
environment:
name: github-pages

permissions:
pages: write
id-token: write

steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4

0 comments on commit f63d0cd

Please sign in to comment.