Documentation #1274
Workflow file for this run
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: Documentation | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
permissions: | ||
contents: write | ||
env: | ||
GOPRIVATE: "github.com/speakeasy-api" | ||
jobs: | ||
docs: | ||
name: Documentation | ||
runs-on: ubuntu-latest | ||
env: | ||
CLI_RUNTIME: "docs" | ||
steps: | ||
- name: Checkout speakeasy repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
path: speakeasy | ||
token: ${{ secrets.SERVICE_BOT_TOKEN }} | ||
- name: Checkout marketing-site repository | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
repository: speakeasy-api/marketing-site | ||
path: marketing-site | ||
token: ${{ secrets.SERVICE_BOT_TOKEN }} | ||
- name: Configure git for private modules | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.SERVICE_BOT_TOKEN }} | ||
run: git config --global url."https://speakeasybot:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com" | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | ||
with: | ||
go-version-file: "speakeasy/go.mod" | ||
- name: Generate CLI docs into marketing-site | ||
working-directory: speakeasy | ||
run: | | ||
go run cmd/docs/main.go -out-dir ../marketing-site/src/content/docs/speakeasy-reference/cli | ||
- name: Generate Release Notes | ||
uses: TriPSs/conventional-changelog-action@67139193614f5b9e8db87da1bd4240922b34d765 # v6.0.0 | ||
with: | ||
github-token: ${{ secrets.SERVICE_BOT_TOKEN }} | ||
output-file: ../marketing-site/RELEASE_NOTES.md | ||
skip-commit: "true" | ||
skip-on-empty: "true" | ||
preset: conventionalcommits | ||
working-directory: ./speakeasy | ||
- name: Check if there are any changes | ||
working-directory: marketing-site | ||
id: git-check | ||
run: | | ||
git config --global user.name "speakeasybot" | ||
git config --global user.email "[email protected]" | ||
git add . | ||
if git diff --cached --quiet; then | ||
echo "changed=false" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "changed=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Create PR against marketing-site | ||
if: steps.git-check.outputs.changed == 'true' | ||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 | ||
with: | ||
path: marketing-site | ||
token: ${{ secrets.SERVICE_BOT_TOKEN }} | ||
commit-message: "docs: update speakeasy CLI docs and/or changelog" | ||
title: "docs: update speakeasy CLI docs and/or changelog" | ||
branch: cli-docs/update | ||
- if: failure() | ||
name: Notify Slack on Failure | ||
uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0 | ||
with: | ||
webhook: ${{ secrets.SLACK_DOCS_WEBHOOK_URL }} | ||
webhook-type: incoming-webhook | ||
payload: | | ||
text: "*CLI to Website Documentation Failure*:" | ||
blocks: | ||
- type: "section" | ||
text: | ||
type: "mrkdwn" | ||
text: "*GitHub Actions Logs*: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Logs>" |