Skip to content

aitechnav/continuous-integration-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI pipeline with Github-actions

This repository was created for the workshop and blog https://dev.to/sudo_anuj/automating-flask-app-deployment-with-docker-github-actions-8gh

**Please star this repository **

  1. Clone the repo
git clone https://github.com/tyagian/cicd_example.git
  1. Build the Docker image
docker build -t flask-webserver .
  1. Run the Container
docker run -p 5000:5000 flask-webserver
  1. Test from browser
Open the Webpage http://localhost:5000

This setup provides a fully functional Flask web server with a responsive homepage, all running inside a Docker container.

CI Pipeline with Github Actions

  1. Inside your GitHub repository, create the following directory and file:
.github/workflows/docker-build.yml
  1. This workflow automates the build and trigger pipeline whenever you push code to the main branch.

  2. Setting Up Secrets in GitHub a. Go to your repository on GitHub. b. Navigate to Settings → Secrets and variables → Actions. c. Click New repository secret and create a secret: Name: GHCR_TOKEN Value: A GitHub Personal Access Token (PAT) with the following read: packages write: packages delete: packages

  3. After the GitHub Action runs successfully, you can pull & run the container using:

docker pull ghcr.io/<your-github-username>/flask-webserver:latest

docker run -p 5000:5000 ghcr.io/<your-github-username>/flask-webserver:latest

-->

About

Continuous Integration with Docker to ghcr

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •