Pages #178
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
name: Pages | |
on: | |
push: | |
paths: | |
- vangen.json | |
schedule: | |
# At 06:00 UTC on Monday. | |
- cron: '0 6 * * 1' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Go | |
uses: ./.github/actions/setup-go-with-cache | |
- name: Install vangen | |
run: go install 4d63.com/[email protected] | |
- name: Install golds | |
run: go install go101.org/[email protected] | |
- name: Build pages | |
run: |- | |
vangen -out build | |
golds -dir=build/doc -gen -silent -footer=simple -wdpkgs-listing=solo all | |
touch build/.nojekyll | |
cat >build/404.html <<'EOF' | |
<!doctype html> | |
<!-- | |
The following meta go-import is for Go modules in private monorepo. | |
Note that this file is a valid XML; see https://go.dev/issue/39748 | |
In addition to that, it should be safe to respond with 404, see | |
https://groups.google.com/d/topic/golang-nuts/1kewLH-Vack | |
--> | |
<meta name="go-import" content="go.pact.im/private git https://gitlab.com/pact/pact-go"> | |
<title>Page not found</title> | |
<pre>404 page not found</pre> | |
EOF | |
echo go.pact.im >build/CNAME | |
- name: Push branch | |
working-directory: build | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: |- | |
git init -q -b gh-pages | |
git config user.name actions-user | |
git config user.email [email protected] | |
git add -A | |
git commit -q -m "${GITHUB_SHA}" | |
git push -f -u "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" gh-pages |