diff --git a/.github/workflows/mdBook.yml b/.github/workflows/mdBook.yml index 660fdce8..87224dda 100644 --- a/.github/workflows/mdBook.yml +++ b/.github/workflows/mdBook.yml @@ -1,29 +1,46 @@ name: mdBook on: + workflow_dispatch: push: branches: - main pull_request: -jobs: - deploy: - runs-on: ubuntu-20.04 - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - steps: - - uses: actions/checkout@v2 +permissions: + contents: read + pages: write + id-token: write +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Pages + uses: actions/configure-pages@v2 - name: Setup mdBook uses: peaceiris/actions-mdbook@v1 with: mdbook-version: "latest" - - run: mdbook build book + - run: mdbook build book -d ../_site - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.ref == 'refs/heads/main' }} - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./book/book + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.gitignore b/.gitignore index 2a0038a4..fd71a9bc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target -.idea \ No newline at end of file +.idea +_site/ \ No newline at end of file