Skip to content

v1.18.0-beta34

v1.18.0-beta34 #2

Workflow file for this run

# Whenever a release is cut, copies the auto-generated reference documentation to the solo-io/docs repo.
name: push-docs
on:
release:
types: [created]
workflow_dispatch:
inputs:
branch:
description: 'LTS branch to execute the workflow for, such as v1.17.x, or main. Supported ONLY for 1.17.x and later (1.16.x and earlier are not in the new docs repo).'
required: true
repository_dispatch:
types: [glooe-release-created]
jobs:
receiver:
runs-on: ubuntu-latest
steps:
- name: The glooe-release-created event is received when a relase is cut in solo-projects repo
id: dispatch-receiver
run: |
dispatch_lts=""
payload="${{ github.event.client_payload.lts }}"
echo "dispatch_lts=$payload" >> $GITHUB_OUTPUT
copy-docs:
runs-on: ubuntu-latest
steps:
- name: Get LTS branch version
id: lts-version
run: |
version=""
if [[ "${{ github.event_name }}" == "release" ]]; then
version=${{ github.event.release.target_commitish }}
elif [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
version=${{ steps.dispatch-receiver.outputs.dispatch_lts }}
else
version=${{ inputs.branch }}
fi
echo "lts=$version" >> $GITHUB_OUTPUT
- name: Set version variables
id: version-variables
run: |
minor=""
directory=""
if [[ "${{ steps.lts-version.outputs.lts }}" == "main" ]]; then
minor="1.18"
directory="main"
elif [[ "${{ steps.lts-version.outputs.lts }}" == "v1.17.x" ]]; then
minor="1.17"
directory="latest"
else
minor="1.18"
directory="main"
fi
echo "minor=${minor}" >> $GITHUB_OUTPUT
echo "directory=${directory}" >> $GITHUB_OUTPUT
- name: Checkout docs repo
uses: actions/checkout@v4
with:
repository: "solo-io/docs"
token: ${{ secrets.DOCS_TOKEN }}
path: docs
fetch-depth: 0
fetch-tags: "true"
- name: Checkout gloo repo
uses: actions/checkout@v4
with:
repository: "solo-io/gloo"
token: ${{ secrets.DOCS_TOKEN }}
path: gloo
ref: ${{ steps.lts-version.outputs.lts }}
- name: Configure Git
run: |
git config --global user.email "github-runner-solo@github.com"
git config --global user.name "github-runner-solo"
- name: Create branch in docs repo
id: create-branch
run: |
pushd docs || exit 1
git checkout main
git pull
branch="post-${{ steps.version-variables.outputs.minor }}-release-docs-copy"
git checkout -b ${branch}
echo "branch=${branch}" >> $GITHUB_OUTPUT
popd || exit 1
- name: Generate docs
env:
GITHUB_TOKEN: ${{ secrets.DOCS_TOKEN }}
run: |
git config --global url."https://github_runner_solo:${GITHUB_TOKEN}@github.com".insteadOf "https://github.com"
pushd gloo || exit 1
make site-common -C docs
popd || exit 1
- name: Copy version changelogs
run: |
pushd docs || exit 1
cp ../gloo/docs/content/static/content/gloo-changelog.docgen static/changelog/gloo-changelog.docgen
cp ../gloo/docs/content/static/content/glooe-changelog.docgen static/changelog/glooe-changelog.docgen
popd || exit 1
- name: Copy security scans
run: |
pushd docs || exit 1
# OSS
cp ../gloo/docs/content/static/content/gloo-security-scan.docgen static/content/gg-security-updates/gloo-security-scan.docgen
cp ../gloo/docs/content/static/content/gloo-security-scan-0.docgen static/content/gg-security-updates/gloo-security-scan-0.docgen
cp ../gloo/docs/content/static/content/gloo-security-scan-1.docgen static/content/gg-security-updates/gloo-security-scan-1.docgen
cp ../gloo/docs/content/static/content/gloo-security-scan-2.docgen static/content/gg-security-updates/gloo-security-scan-2.docgen
cp ../gloo/docs/content/static/content/gloo-security-scan-3.docgen static/content/gg-security-updates/gloo-security-scan-3.docgen
cp ../gloo/docs/content/static/content/gloo-security-scan-4.docgen static/content/gg-security-updates/gloo-security-scan-4.docgen
# Enterprise
cp ../gloo/docs/content/static/content/glooe-security-scan.docgen static/content/gg-security-updates/glooe-security-scan.docgen
cp ../gloo/docs/content/static/content/glooe-security-scan-0.docgen static/content/gg-security-updates/glooe-security-scan-0.docgen
cp ../gloo/docs/content/static/content/glooe-security-scan-1.docgen static/content/gg-security-updates/glooe-security-scan-1.docgen
cp ../gloo/docs/content/static/content/glooe-security-scan-2.docgen static/content/gg-security-updates/glooe-security-scan-2.docgen
cp ../gloo/docs/content/static/content/glooe-security-scan-3.docgen static/content/gg-security-updates/glooe-security-scan-3.docgen
cp ../gloo/docs/content/static/content/glooe-security-scan-4.docgen static/content/gg-security-updates/glooe-security-scan-4.docgen
popd || exit 1
- name: Copy security posture
run: |
pushd docs || exit 1
cp ../gloo/docs/content/reference/security-posture.yaml static/content/examples/manual/security-posture.yaml
popd || exit 1
- name: Copy OSA
run: |
pushd docs || exit 1
cp ../gloo/docs/content/static/content/osa_included.md assets/conrefs/pages/gateway/reference/osa_included_${{ steps.version-variables.outputs.minor }}.md
cp ../gloo/docs/content/static/content/osa_provided.md assets/conrefs/pages/gateway/reference/osa_provided_${{ steps.version-variables.outputs.minor }}.md
popd || exit 1
- name: Copy Helm
run: |
pushd docs || exit 1
# OSS
cp ../gloo/docs/content/reference/values.txt assets/conrefs/pages/reference/helm/values_${{ steps.version-variables.outputs.minor }}.txt
# Enterprise
cp ../gloo/docs/content/static/content/glooe-values.docgen assets/conrefs/pages/reference/helm/glooe-values_${{ steps.version-variables.outputs.minor }}.md
- name: Copy CLI
run: |
pushd docs || exit 1
cp ../gloo/docs/content/reference/cli/glooctl_check.md content/en/gateway/${{ steps.version-variables.outputs.directory }}/reference/cli/glooctl_check.md
cp ../gloo/docs/content/reference/cli/glooctl_install_gateway.md content/en/gateway/${{ steps.version-variables.outputs.directory }}/reference/cli/glooctl_install_gateway.md
cp ../gloo/docs/content/reference/cli/glooctl_install_gateway_enterprise.md content/en/gateway/${{ steps.version-variables.outputs.directory }}/reference/cli/glooctl_install_gateway_enterprise.md
cp ../gloo/docs/content/reference/cli/glooctl_uninstall.md content/en/gateway/${{ steps.version-variables.outputs.directory }}/reference/cli/glooctl_uninstall.md
cp ../gloo/docs/content/reference/cli/glooctl_upgrade.md content/en/gateway/${{ steps.version-variables.outputs.directory }}/reference/cli/glooctl_upgrade.md
popd || exit 1
- name: Push and create PR
env:
GITHUB_TOKEN: ${{ secrets.DOCS_TOKEN }}
run: |
pushd docs || exit 1
git add .
git commit -m "Copy auto-generated docs from the gloo repo, post-release of ${{ steps.version-variables.outputs.minor }}"
git push --set-upstream origin ${{ steps.create-branch.outputs.branch }}
gh pr create \
--title "[Automated] Post-release docsgen for ${{ steps.version-variables.outputs.minor }}" \
--body "Copy auto-generated docs from the gloo repo, post-release of ${{ steps.version-variables.outputs.minor }}" \
--base main \
--head ${{ steps.create-branch.outputs.branch }} \
--reviewer solo-io/solo-docs
popd || exit 1
slack-notification:
runs-on: ubuntu-latest
needs:
- copy-docs
steps:
- name: Notify on workflow success
if: |
needs.copy-docs.result == 'success'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
run: |
MESSAGE="✅ *Success:* Automated copy of reference docs for ${{ steps.version-variables.outputs.minor }} was successful. <https://github.com/solo-io/docs/pulls|Review the PR>"
curl \
-d "text=$MESSAGE" \
-d "channel=doctopus-tests" \
-d "token=${SLACK_BOT_TOKEN}" \
-X POST https://slack.com/api/chat.postMessage
- name: Notify on workflow failure
if: |
needs.copy-docs.result == 'failure'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
run: |
JOB_URL=https://github.com/solo-io/gloo/actions/runs/${GITHUB_RUN_ID}
MESSAGE="❌ *Failure:* Automated copy of reference docs for ${{ steps.version-variables.outputs.minor }} failed. <${JOB_URL}|Review the workflow failure>"
curl \
-d "text=$MESSAGE" \
-d "channel=doctopus-tests" \
-d "token=${SLACK_BOT_TOKEN}" \
-X POST https://slack.com/api/chat.postMessage