Skip to content

Commit

Permalink
setting up github workflow yaml file and updating readme.md with cont…
Browse files Browse the repository at this point in the history
…inuous deployment concepts
  • Loading branch information
avr2002 committed May 18, 2024
1 parent 0ba4d5e commit a94cc95
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Build, Test, and Publish

# triggers: whenever there is new changes pulled/pushed on this
# repo under given conditions, run the below jobs
on:
pull_request:
types: [opened, synchronize]
push:
branches:
- main
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
workflow_dispatch:

jobs:

build-test-and-publish:
runs-on: ubuntu-latest
steps:
# github actions checksout, clones our repo, and checks out the branch we're working in
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Run
run: |
/bin/bash run.sh install
/bin/bash run.sh build
/bin/bash run.sh publish:test
# env:
# TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install pre-commit
# - name: Running pre-commit hooks
# run: |
# SKIP=no-commit-to-branch pre-commit run --all-files


# https://docs.github.com/en/actions/learn-github-actions/contexts#example-printing-context-information-to-the-log
dump_contexts_to_log:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps) }}
run: echo "$STEPS_CONTEXT"
- name: Dump runner context
env:
RUNNER_CONTEXT: ${{ toJson(runner) }}
run: echo "$RUNNER_CONTEXT"
- name: Dump strategy context
env:
STRATEGY_CONTEXT: ${{ toJson(strategy) }}
run: echo "$STRATEGY_CONTEXT"
- name: Dump matrix context
env:
MATRIX_CONTEXT: ${{ toJson(matrix) }}
run: echo "$MATRIX_CONTEXT"
- name: Dump Secrets
env:
SECRETS_CONTEXT: ${{ toJson(secrets) }}
run: echo "$SECRETS_CONTEXT"
- name: Dump Variables
run: echo "${{ toJson(vars) }}"
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -741,3 +741,37 @@ twine upload --help

- [`justfile`](https://github.com/casey/just)
- [pyinvoke](https://www.pyinvoke.org/)

* **

# Continuous Delivery using GitHub Actions

## Goals
1. Understand Continuous Delivery
2. Know the parts of a CI/CD pipeline for Python Packages
3. Have an advanced understanding of GitHub Actions



## Delivery "Environments"

>Dev $\rightarrow$ QA/Staging $\rightarrow$ Prod

- Pre-release version namings
- 0.0.0rc0 (rc = release candidate)
- 0.0.0.rc1
- 0.0.0a0 (alpha)
- 0.0.0b1 (beta)

![alt text](https://github.com/avr2002/python-packaging/blob/main/packaging_demo/assets/cd.png?raw=true)


## High-level CI/CD Workflow for Python Packages

![CI/CD Workflow for Python Packages](https://github.com/avr2002/python-packaging/blob/main/packaging_demo/assets/workflow.png?raw=true)


## Detailed CI/CD Workflow for Python Packages

![Detailed CI/CD Workflow for Python Packages](https://github.com/avr2002/python-packaging/blob/main/packaging_demo/assets/detailed-workflow.png?raw=true)

0 comments on commit a94cc95

Please sign in to comment.