Skip to content

Expand Quick Start with richer examples #84

Expand Quick Start with richer examples

Expand Quick Start with richer examples #84

Workflow file for this run

name: GoDoc
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Generate redirect page
run: |
MODULE=$(go list -m)
mkdir -p _site
cat > _site/index.html << EOF
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url='https://pkg.go.dev/${MODULE}'">
<link rel="canonical" href="https://pkg.go.dev/${MODULE}">
<title>go-inflect - Go Package Documentation</title>
</head>
<body>
<p>Redirecting to <a href="https://pkg.go.dev/${MODULE}">pkg.go.dev documentation</a>...</p>
</body>
</html>
EOF
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: '_site'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4