diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 795c546e19f..ef172b1b19c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,7 +5,7 @@ on: - master jobs: - deploy: + build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -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