Skip to content

Commit

Permalink
Use actions/deploy-pages to deploy mdbook output
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Apr 18, 2023
1 parent e66fda2 commit 6834ff9
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/[email protected]
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/[email protected]

0 comments on commit 6834ff9

Please sign in to comment.