.github/workflows/quick-docs.yaml #31
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
################################ | |
## Docs Readme Publish ## | |
## Reusable Workflow ## | |
################################ | |
# 1. Gets state on tagged commit | |
# 2. creates an empemeral branch | |
# 3. pushes the empemeral branch to GitHub | |
# 4. creates a PR from empemeral branch to docs-auto branch | |
# 5. merges the PR into docs-auto branch, on successful Docs Build | |
# 6. Deletes the empemeral branch | |
###### Quick Release Tagging ####### | |
# export tt='quick-release'; git tag -d "$tt"; git push --delete origin "$tt"; git tag "$tt" && git push origin "$tt" | |
############## OR ############## | |
# export tt='quick-release' | |
# git tag -d "$tt" | |
# git push --delete origin "$tt" | |
# git tag "$tt" | |
# git push origin "$tt" | |
#################################### | |
# PR: empemeral-doc-updates --> docs-auto | |
# Trigger only on push of a 'quick-release' tag, on any branch | |
on: | |
# on tag with name 'quick-release' only | |
push: | |
tags: | |
- quick-release | |
jobs: | |
release_readme: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Add repository path as safe.directory for Git global config by running `git | |
# config --global --add safe.directory <path>` | |
# Default: true | |
set-safe-directory: '' | |
- run: git log --graph --decorate --color --all --stat | |
### CREATE BRANCH doc-updates-carrier-sl ### | |
- run: git checkout -b doc-updates-carrier-sl | |
- run: git push -u origin HEAD | |
### CREATE BRANCH docs-release-candidate-sl ### | |
- run: git checkout master | |
- run: git checkout -b docs-release-candidate-sl | |
- run: git push -u origin HEAD | |
- run: git log --graph --decorate --color --all --stat | |
# here Codacy does not trigger, because branch does not have more than 2 commits over that past 2 weeks | |
# see: https://docs.codacy.com/repositories-configure/managing-branches/ | |
# probably not needed | |
- run: git checkout doc-updates-carrier-sl | |
############## PR ############## | |
- name: 'Create PR doc-updates-carrier-sl --> docs-release-candidate-sl' | |
# --head is the branch where the changes were developed | |
# --base is the branch you want to merge the changes into | |
run: | | |
gh pr create --head doc-updates-carrier-sl --base docs-release-candidate-sl \ | |
--title "Documentation Updates - Merge to Docs-Release sl Branch" \ | |
--body "This PR is automatically generated by a GitHub Action workflow. \ | |
It contains documentation updates that were pushed to the 'quick-release' tag. \ | |
\n\n\ | |
Tag 'quick-release' -> Branch 'doc-updates-carrier-sl' -> Branch 'docs-release-candidate-sl' \ | |
\n\n\ | |
Automatic merge happens, if the Documentation Build, on RTD CI, was Successful! \ | |
\n\n\ | |
Please do not close this PR manually." | |
############## Merge ############## | |
- name: 'Merge PR doc-updates-carrier-sl --> docs-release-candidate-sl' | |
run: gh pr merge doc-updates-carrier-sl --auto --delete-branch --squash | |
# HEAD is now at docs-release-candidate-sl | |
- run: git fetch | |
- run: git log --graph --decorate --color --all --stat | |
- run: echo "Expect above log to proove local and origin empemeral-doc-updates branches are deleted" | |
### WORKFLOW No 2 - EMBEDDED ### | |
- run: git log --graph --decorate --color --all --stat | |
############## PR ############## | |
- name: 'Create PR docs-release-candidate-sl --> master' | |
# --head is the branch where the changes were developed | |
# --base is the branch you want to merge the changes into | |
run: | | |
gh pr create --head docs-release-candidate-sl --base master \ | |
--title "Documentation Updates - Release (Merging to 'master' branch)" \ | |
--body "This PR is automatically generated by a GitHub Action workflow. \ | |
\n\n\ | |
It contains documentation updates that were pushed to the 'release' branch. \ | |
\n\n\ | |
To verify Docs CI Build passed, see the PR's 'Checks Section', in this web UI \ | |
\n\n\ | |
Next, steps if needed should be: \ | |
\n\n\ | |
1. Verify only docs/ folder or mkdocs.yml file where changed, excluding commits that might happen after this PR had opened \ | |
\n\n\ | |
2. Update, commit, and push below files to br release, to Bump Sem Ver for new Release \n \ | |
- README.rst\n \ | |
- src/cookiecutter_python/__init__.py\n \ | |
- pyproject.toml\n \ | |
- docs/conf.py\n \ | |
\n\n\ | |
3. Update, commit, and push CHNAGELO.rst, with new release info \n \ | |
\n\n\ | |
4. Merge this PR into 'master' branch \ | |
\n\n\ | |
After that, a tag on master branch should follow up. | |
\n\n\ | |
Then making requires Releases/Deployments/Uploads can also follow up. Eg: \n \ | |
- Python Distribution upload to PyPi \n \ | |
- Docker Image upload to Docker Hub \n \ | |
- GitHub Release upload to GitHub \n" |