Reusable Workflows
for CI/CD Pipelines, implemented in Github Actions
.
Documentation available at https://automated-workflows.readthedocs.io.
- Source: https://github.com/boromir674/automated-workflows
- CI: https://github.com/boromir674/automated-workflows/actions
- Python Build: Build n Test Python Distributions.
- Docker: Build Docker image and Push to Dockerhub.
- 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
List any prerequisites that users need before using your workflows. For example:
- 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"
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 }}
We publish to Dockerhub tested builds.
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