Created
July 1, 2020 13:28
-
-
Save MarkWarneke/bde5eddaa81d5b5eac93ebf80e864976 to your computer and use it in GitHub Desktop.
Gist to publish docs branch as Github pages. By CompositionalIT/farmer
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: gh-pages | |
| on: | |
| push: | |
| branches: [ docs ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-18.04 | |
| steps: | |
| - name: Checkout docs branch | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: docs # Pull the docs branch | |
| submodules: true # Fetch Hugo themes as well (they're in sub-modules) | |
| fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v2 | |
| with: | |
| hugo-version: '0.68.3' | |
| - name: Build # Builds using hugo; outputs to ./public by default | |
| run: hugo --minify | |
| - name: Deploy # Pushes output of the build to the GH Pages branch | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| commit_message: ${{ github.event.head_commit.message }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./public |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/CompositionalIT/farmer/blob/docs/.github/workflows/gh-pages.yml