Skip to content

Commit

Permalink
ci: try publish pages with official action
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDark committed Nov 5, 2024
1 parent c2931c2 commit 097fe66
Showing 1 changed file with 28 additions and 16 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ on:
paths:
- docs/**

permissions:
contents: write

jobs:
deploy:
name: Deploy Documentation
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,15 +34,30 @@ jobs:
pnpm i
pnpm build
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: github.event_name == 'push' # && github.ref == 'refs/heads/main'
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./docs/build
# Assign commit authorship to the official GH-Actions bot
user_name: github-actions[bot]
user_email: github-actions[bot]@users.noreply.github.com
path: ./docs/build

# Deploy job
deploy:
# Add a dependency to the build job
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action

0 comments on commit 097fe66

Please sign in to comment.