Skip to content

Commit

Permalink
Merge pull request #3419 from Turbo87/github-deploy
Browse files Browse the repository at this point in the history
Use `actions/deploy-pages` to deploy `mdbook` output
  • Loading branch information
Mark-Simulacrum committed Apr 29, 2023
2 parents d1df23c + 6834ff9 commit ef26c15
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- master

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -19,16 +19,23 @@ jobs:
- name: Generate Book
run: |
./generate-book.py
- name: Deploy GitHub Pages
run: |
git worktree add gh-pages gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../book/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force
- name: Upload Artifact
uses: actions/upload-pages-artifact@v1.0.8
with:
path: ./book

deploy:
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v2.0.0

0 comments on commit ef26c15

Please sign in to comment.