Reusable Workflows
for CI/CD Pipelines, implemented in Github Actions
.
Live Documentation at https://automated-workflows.readthedocs.io.
- Source: https://github.com/boromir674/automated-workflows
- CI: https://github.com/boromir674/automated-workflows/actions
- CI/CD
- Docker: Build Docker image and Push to Dockerhub.
- Python Build: Build n Test Python Distributions.
- PyPI: Upload Python distribution to PyPI
- Docs Build: Docs Site Build with
Mkdocs
orSphinx
- Lint: Static Code Analysis
- Code Visualization: Visualize Python Code as an
svg
Graph ofModule Imports
- Git Ops
- Open PR to Boarding: Open a PR on a Boarding Branch
- Acceptance as Single Job Status: Model Git Ops Acceptance as one Job
Note
See the API References
in the Documentation for all the Reusable Workflows
.
release-me
: Ship your Branch tomain
with 2 Steps/PRs
Note
See the how-to
Guides for implementing your Git Ops Processes.
Continuously Publish to Dockerhub using docker.yml
.
- GitHub account.
- Access to a repository.
- Passing a proper DOCKER_USER from
context
- Passing a proper DOCKER_PASSWORD from
secrets
"We publish to Dockerhub only Tested Builds"
Quick-start
graph LR
workflow_triggered("CI Start") --> rt{"Do QA?"}
rt -- Yes --> cit
cit["Run Tests"] --> ifpass{"Passed?"}
ifpass -- "Yes" --> run_docker["Publish Docker"]
ifpass -- "No" --> do_not_publish_broken_build["Decline Publish"]
rt -- No --> do_not_publish_broken_build
env:
DO_QA: true
jobs:
build_n_test:
runs-on: ubuntu-latest
if: always() && ${{ env.DO_QA == 'true' }}
steps:
- run: echo "Build Code and run Tests"
call_docker_job:
needs: build_n_test
uses: boromir674/automated-workflows/.github/workflows/docker.yml@test
with:
DOCKER_USER: ${{ vars.DOCKER_USER }}
acceptance_policy: 2
image_slug: "my_app_name"
image_tag: "1.0.0"
tests_pass: ${{ needs.build_n_test.result == 'success' }}
tests_run: ${{ !contains(fromJSON('["skipped", "cancelled"]'), needs.build_n_test.result) }}
secrets:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- "Publish to Dockerhub Builds bearing a 'Tests Passed' or a 'Tests Skipped'"
Quick-start
- Not tested builds (ie when CI Test Job is skipped for any reason), are still treated as eligible for Docker Publish.
- Useful to trigger Docker Job, without waiting for Tests.
graph LR
workflow_triggered("CI Start") --> rt{"Run QA?"}
rt -- Yes --> cit
cit["Run Tests"] --> ifpass{"Passed?"}
ifpass -- "Yes" --> run_docker["Publish Docker"]
ifpass -- "No" --> do_not_publish_broken_build["Decline Publish"]
rt -- No --> run_docker
env:
DO_QA: false
jobs:
build_n_test:
runs-on: ubuntu-latest
if: always() && ${{ env.DO_QA == 'true' }}
steps:
- run: echo "Build Code and run Tests"
call_docker_job:
needs: build_n_test
uses: boromir674/automated-workflows/.github/workflows/docker.yml@test
with:
DOCKER_USER: ${{ vars.DOCKER_USER }}
acceptance_policy: 3
image_slug: "my_app_name"
image_tag: "1.0.0"
tests_pass: ${{ needs.build_n_test.result == 'success' }}
tests_run: ${{ !contains(fromJSON('["skipped", "cancelled"]'), needs.build_n_test.result) }}
secrets:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- See the LICENSE file to read the License, under which this Project is released under.
- This project is licensed under the GNU Affero General Public License v3.0.
- Free software:
GNU Affero General Public License v3.0