Skip to content

Commit

Permalink
[NEW] Automated Workflows v1.7.1
Browse files Browse the repository at this point in the history
Merging 'release' in 'main' - Releasing into Production
  • Loading branch information
boromir674 authored Aug 16, 2024
2 parents e920ba9 + b1212b6 commit 75ed530
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 19 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/_gitops-pr-to-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
pr_to_release:
uses: ./.github/workflows/go-pr-to-release.yml
with:
release_branch: ${{ vars.GITOPS_RELEASE_BRANCH || 'release' }}
release_branch: ${{ vars.GIT_RELEASE_BRANCH || 'release' }}
secrets:
# since job does auto merge pat needs read/write to PRs and to Actions
github_pat: ${{ secrets.GA_WORKFLOWS_CI_PR_RW_AND_ACTIONS_RW }}
# - `Contents` Write, to allow **merging (auto) PRs**
# - `Pull Requests` Write, to allow **opening PRs**
# - `Actions` Write, to allow **triggering Workflows**
2 changes: 1 addition & 1 deletion .github/workflows/_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
# PAT with 2 permissions for:
# - 'Pull requests' -> 'create labels': to allow this Action to create labels
# - 'Actions' -> 'Workflows': to enable triggering other Workflows (listening to label creation events)
repo-token: ${{ secrets.GA_WORKFLOWS_CI_LABELER }}
repo-token: ${{ secrets.GA_WORKFLOWS_CI_PR_RW_AND_ACTIONS_RW }}
2 changes: 1 addition & 1 deletion .github/workflows/go-pr-to-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:
if [ -n "${{ inputs.backwords_compatibility }}" ]; then
echo "[WARN]: Unsupported value for input 'backwords_compatibility': '${{ inputs.backwords_compatibility }}'" >> $GITHUB_STEP_SUMMARY
else
echo "[INFO]: Value for input `backwords_compatibility` not provided." >> $GITHUB_STEP_SUMMARY
echo '[INFO]: Value for input `backwords_compatibility` not provided.' >> $GITHUB_STEP_SUMMARY
echo "- Simply we assume user does not know/specify, and we do nothing about it." >> $GITHUB_STEP_SUMMARY
fi
echo BACKWORDS_COMPATIBILITY='' >> $GITHUB_ENV
Expand Down
8 changes: 8 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ build:
# golang: "1.19"

# ALL JOBS implied: https://docs.readthedocs.io/en/stable/builds.html

# Step Customizable jobs
# Checkout post_checkout
# System dependencies pre_system_dependencies, post_system_dependencies
# Create environment pre_create_environment, post_create_environment
# Install pre_install, post_install
# Build pre_build, post_build

jobs:
# post_system_dependencies:
# - python3 -m pip install --user poetry
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/).

## 1.7.1 (2024-09-16)

### Changes

##### fix

- expect Contents Write permission in release-me PAT
- console logging message when no inputs.backwords_compatibility is given

##### docs

- improve Git Ops Release Me Run How-to Guide
- render text Tooltip when hovering on CI/CD introduction text
- enable abbr markdown extension in mkdocs build


## 1.7.1-dev1 (2024-09-15)

Adding `How-to` Guide for **Running** `release-me` **Git Ops Process**.
Expand Down
10 changes: 10 additions & 0 deletions docs/guides/gitops/run/guide_run_gitops_release_me_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ This is a `how-to` Guide, with everything you need, to "run" the
6. Fire-up a `auto-prod-<sem ver>` git tag event (ie `auto-prod-1.2.0`)
```sh
export _SEM_VER=...
```
```sh
export _tag="auto-prod-${_SEM_VER}"
git tag -d "$_tag"; git push --delete origin "$_tag";
git tag "$_tag" && git push origin "$_tag"
```
7. If, you have setup `Human Approval`, give the Release a **green light**, by approving a Code Review.
</div>
Expand Down
22 changes: 16 additions & 6 deletions docs/guides/gitops/setup/guide_setup_gitops_release_me.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ For more on *Phase 1* of this **Git Ops Process**, see the [*Release Me Phase 1*

## Prerequisites
- a `github repository`
<!-- - a Github Personal access token, such as a `Fine-grained` token with minimum below permissions:
- `Contents` Write, to allow **merging PRs**
- `Pull Requests` Write, to allow **opening PRs**
- `Actions` Write, to allow **triggering Workflows** -->

[//]: # (Code Write for calling merge GH API)
[//]: # (PR Write for creating PR, and possible labels)
[//]: # (Actions Write to allow triggering other Git Ops Workflows, on events this workflow fires)

- **Auto Merge** is ON, on Github Repository Settings

## Guide
Expand All @@ -41,9 +50,9 @@ jobs:
pr_to_release:
uses: boromir674/automated-workflows/.github/workflows/go-pr-to-release.yml@fda3c758fa361c49e056977b1aeb0b2be01c99f1 # v1.6.1
with:
release_branch: ${{ "{{" }} vars.GIT_RELEASE_BRANCH || 'release' {{ "}}" }}
release_branch: ${{ vars.GIT_RELEASE_BRANCH || 'release' }}
secrets:
github_pat: ${{ "{{" }} secrets.PR_RW_AND_ACTIONS_RW {{ "}}" }}
github_pat: ${{ secrets.GH_TOKEN_GITOPS_RELEASE_ME }}
```
{% endraw %}
to automatically open **PR to release**, when `release-me` git tag events happen.
Expand All @@ -67,10 +76,10 @@ jobs:
)
uses: boromir674/automated-workflows/.github/workflows/go-pr-to-main.yml@fda3c758fa361c49e056977b1aeb0b2be01c99f1 # v1.6.1
with:
main_branch: ${{ "{{" }} vars.GIT_MAIN_BRANCH || 'main' {{ "}}" }}
release_branch: ${{ "{{" }} vars.GIT_RELEASE_BRANCH || 'release' {{ "}}" }}
main_branch: ${{ vars.GIT_MAIN_BRANCH || 'main' }}
release_branch: ${{ vars.GIT_RELEASE_BRANCH || 'release' }}
secrets:
PR_RW_AND_ACTIONS_RW: '${{ "{{" }} secrets.PR_RW_AND_ACTIONS_RW {{ "}}" }}'
PR_RW_AND_ACTIONS_RW: '${{ secrets.GH_TOKEN_GITOPS_RELEASE_ME }}'
```
{% endraw %}
to automatically open **PR to main**, when events satisfying all below conditions, happen:
Expand All @@ -81,10 +90,11 @@ to automatically open **PR to main**, when events satisfying all below condition
### 3. Grant required Permissions to manipulate PRs and trigger Workflows

1. Create a **PAT**, scoped for your repository, bearing the `read/write` permission for:
- *Contents*
- *Pull Requests*
- *Actions*
2. Make PAT available to your repo as a `Repository Secret`
1. Create **Repository Secret** with `name` `PR_RW_AND_ACTIONS_RW`
1. Create **Repository Secret** with `name` `GH_TOKEN_GITOPS_RELEASE_ME`
2. Set **Repository Secret** `value` the **PAT**


Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Automated Workflows

Implement `CI/CD` and `Git Ops`, with `Github Actions Reusable Workflows`.
Implement `CI/CD`{ title="Continuous Integration/Continuous Delivery" } and `Git Ops`, with `Github Actions Reusable Workflows`.


[![CI Status](https://img.shields.io/github/actions/workflow/status/boromir674/automated-workflows/cicd.yml?style=plastic&logo=github-actions&logoColor=lightblue&label=CI%20Tests&color=lightgreen&link=https%3A%2F%2Fgithub.com%2Fboromir674%2Fautomated-workflows%2Factions%2Fworkflows%2Fcicd.yml)](https://github.com/boromir674/automated-workflows/actions/workflows/cicd.yml)

Expand Down
25 changes: 17 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ theme:
# - navigation.tracking
# - navigation.instant

### CSS DESIGN ###
# Allow writting css to a single css file,
# eg avoids need to add <style> elements in markdown, in case custom styles required

# extra_css:
# - css/extra.css


plugins:
# Enable jinja inside your markdown files
# - allows {% include %} statements
Expand Down Expand Up @@ -80,7 +88,15 @@ markdown_extensions:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg

#### SIDE NAVIGATION ####
### On-HOVER TOOLTIP ###
# abbr by default supports tooltips on url links
- abbr
# if attr_list is also added, then tooltips on other html elements are supported as below:
# ie :material-information-outline:{ title="Important information" }



#### SIDE NAVIGATION - DESIGN ####
nav:
# each item in the list, renders a left side navigation item/page
- Home:
Expand Down Expand Up @@ -126,10 +142,3 @@ nav:
- tags: tags.md
extra:
generator: false


# Allow writting css to a single css file,
# eg avoids need to add <style> elements in markdown, in case custom styles required

# extra_css:
# - css/extra.css

0 comments on commit 75ed530

Please sign in to comment.