This repository contains a small Python helper script, doc-dockerfile.py
, which bootstraps a GitHub Actions workflow to:
- Generate a basic
Dockerfile
- Build a Docker image from it
- Save the image as a
image.tar
archive - Create and push a timestamped Git tag
- Create a GitHub Release for that tag
- Python 3
- Tested on Python 3.6+.
-
doc-dockerfile.py
A Python script that creates/\.github/workflows/gen-dockerfile.yml
containing the full CI/CD pipeline. -
.github/workflows/gen-dockerfile.yml
(generated)
Defines a single workflow,build-and-release
, that runs on pushes tomain
.
-
Clone your repo (if you haven’t already):
git clone git@github.com:ImNotVarun/Automated-Build-Deployment-Workflow.git cd Automated-Build-Deployment-Workflow
-
Run the generator script:
python3 doc-dockerfile.py
- If a workflow already exists, the script will do nothing.
- Otherwise, it will:
- Create
.github/workflows/gen-dockerfile.yml
- Prompt you to commit & push.
- Create
- On every push to
main
:- GitHub Actions spins up an Ubuntu VM.
- It checks out your code.
- It echoes a minimal
Dockerfile
. - It builds the Docker image (
docker build
). - It saves the image as
image.tar
. - It creates & pushes a timestamped Git tag (
vYYYYMMDDHHMMSS
). - It creates a GitHub Release for that tag.
- It uploads only
image.tar
as the release asset.