Fix GitHub Actions permissions #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Docusaurus to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write # Grants write access to the repo | |
pages: write # Allows updating GitHub Pages | |
id-token: write # Required for secure deployments | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false # Avoid using SSH keys | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build Docusaurus site | |
run: yarn build | |
- name: Deploy to GitHub Pages | |
env: | |
GIT_USER: github-actions[bot] | |
USE_SSH: false | |
GIT_URL: https://github.com/blacksky-algorithms/blacksky-algorithms.github.io.git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
yarn deploy |