diff --git a/.github/actions/buildresources/action.yaml b/.github/actions/buildresources/action.yaml index e7278a5..5b03018 100644 --- a/.github/actions/buildresources/action.yaml +++ b/.github/actions/buildresources/action.yaml @@ -40,17 +40,22 @@ runs: run: | if (test -a book/_build/html/reports/*log); then cat book/_build/html/reports/*log ; fi - - name: Publish to GitHub Pages + - name: Upload Pages HTML if: inputs.publish-to-gh == 'true' - uses: peaceiris/actions-gh-pages@v3 + uses: actions/upload-pages-artifact@v3 with: - github_token: ${{github.token}} - publish_dir: book/_build/html - publish_branch: gh-pages - enable_jekyll: false - cname: book-template.hackweek.io + path: _build/html - - name: Save Build + - name: Setup GitHub Pages + if: inputs.publish-to-gh == 'true' + uses: actions/configure-pages@v5 + + - name: Deploy to GitHub Pages + if: inputs.publish-to-gh == 'true' + id: deployment + uses: actions/deploy-pages@v4 + + - name: Upload Complete Build Folder if: ${{ always() && inputs.jb-save == 'true'}} uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 4934557..6e18495 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,5 +1,11 @@ name: Deploy +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + on: push: paths: @@ -15,7 +21,9 @@ on: jobs: build-and-deploy: runs-on: ubuntu-latest - + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -34,4 +42,4 @@ jobs: jb-cache: false publish-to-gh: true jb-save: true - token: ${{ secrets.GH_PAT }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 51c32dc..f69a182 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ You can use this template for your own event! 1. Click the "Use this template" button at the top of the repo 1. Select the account where you'd like to use the template. -1. **Be sure to select the checkbox to include all branches!** Otherwise your book will not be rendered automatically. You can remove all branches except for `main` and `gh-pages` from your new repo. -1. In your new repo, go to Settings > Pages to find the link to your JupyterBook. We recommend adding this link to the home page. +1. In your new repo, got to Settings --> Pages --> Source = GitHub Actions + 1. Enter a Custom Domain if you have one, or use the default GitHub Pages URL 1. There are a few files you'll need to edit to customize content for your event: * `cookiecutter.yaml`: customize your landing page content * `book/_config.yml`: customize your JupyterBook content