This repository has been archived by the owner on May 31, 2024. It is now read-only.
github pages #56
This file contains 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
# Build docs and publish to github pages | |
name: github pages | |
on: | |
workflow_dispatch: # Allow manual triggering of the action | |
release: | |
types: [published] | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
- name: Setup Hugo | |
uses: peaceiris/actions-hugo@v2 # see https://github.com/peaceiris/actions-hugo for details | |
with: | |
hugo-version: '0.85.0' | |
extended: true | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Cache dependencies | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Setup Go environment | |
uses: actions/[email protected] | |
with: | |
go-version: 1.19.3 | |
- name: Clean Docs | |
run: make clean-docs | |
- name: Generate Docs | |
run: > | |
(cd packages/cli && go mod vendor) && | |
(cd site && mkdir -p themes && cd themes && git clone --recurse-submodules --depth 1 https://github.com/google/docsy.git) && | |
make docs | |
- name: Deploy To Pages | |
uses: peaceiris/actions-gh-pages@v3 # see https://github.com/peaceiris/actions-gh-pages for details | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages # set to 'gh-pages to publish to github pages' | |
publish_dir: ./docs # Deploy the contents of ./docs to github pages |