Deploy GitHub Pages with private submodule #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy GitHub Pages with private submodule | |
| on: | |
| push: | |
| branches: | |
| - main # run workflow on pushes to main | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checkout repo + private submodules | |
| - name: Checkout repository with private submodules | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive # fetch all submodules | |
| token: ${{ secrets.HORSEL_ACCESS }} # PAT with read access to private submodules | |
| fetch-depth: 0 # full history | |
| # Deploy site to gh-pages | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} # auto-provided by GitHub | |
| publish_dir: ./ # folder containing site + submodules | |
| publish_branch: gh-pages # branch for Pages deployment | |
| force_orphan: true # overwrite gh-pages completely | |
| commit_message: "Deploy site via GitHub Actions" |