Skip to content

Pages

Pages #138

Workflow file for this run

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/checkout@v3.3.0
- name: Set up Go
uses: ./.github/actions/setup-go-with-cache
- name: Install vangen
run: go install 4d63.com/vangen@v1.2.0
- name: Install golds
run: go install go101.org/golds@v0.4.9
- 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 actions@github.com
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