feat: fixed stupid bug #101
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: Generate Documentation | |
on: | |
push: | |
branches: | |
- "main" | |
- "stable" | |
jobs: | |
docs: | |
name: Generate Docs | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'gominima' | |
outputs: | |
REPO_NAME: ${{ steps.env.outputs.REPO_NAME }} | |
BRANCH_NAME: ${{ steps.env.outputs.BRANCH_NAME }} | |
BRANCH_OR_TAG: ${{ steps.env.outputs.BRANCH_OR_TAG }} | |
SHA: ${{ steps.env.outputs.SHA }} | |
steps: | |
- name: Checkout repository | |
uses: actions/[email protected] | |
- name: Setup Go environment | |
uses: actions/[email protected] | |
with: | |
go-version: 1.17 | |
- name: Get docgen | |
run: go get github.com/gominima/docgen | |
- name: Run docgen | |
run: go run github.com/gominima/docgen . $(basename `git rev-parse --show-toplevel`)-$(git rev-parse --abbrev-ref HEAD).json | |
- name: Checkout docs repository | |
uses: actions/checkout@v2 | |
with: | |
repository: 'gominima/docs' | |
token: ${{ secrets.API_TOKEN_GITHUB }} | |
path: 'out' | |
- name: Commit and push | |
run: | | |
mv $(basename `git rev-parse --show-toplevel`)-$(git rev-parse --abbrev-ref HEAD).json out | |
cd out | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git add . | |
git commit -m "Docs build for ${GITHUB_REF_TYPE} ${GITHUB_REF_NAME}: ${GITHUB_SHA}" || true | |
git push |