#33 - test doc generate action with push commit #2
Workflow file for this run
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 commands documentation | |
on: | |
push: | |
branches: | |
- develop | |
- hotfix/* | |
- feature/* | |
permissions: | |
contents: write | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21 | |
- name: Run GoReleaser artifact build | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: v1.23.0 | |
args: build --clean --skip=validate | |
- name: Generate and commit new commands documentation | |
run: | | |
# constants for selecting branches | |
readonly GIT_BRANCH="${GITHUB_REF_NAME}" | |
readonly GITHUB_ORG="${GITHUB_REPOSITORY_OWNER}" | |
echo "Configure Git user.name and user.email." | |
git config user.name github-actions | |
git config user.email [email protected] | |
echo "Generate new commands documentation." | |
./dist/rmk_linux_amd64_v1/rmk doc generate > ./docs/commands.md | |
if (git commit --all --message="Update commands documentation"); then | |
git push | |
echo "The new commands documentation was committed." | |
fi |