Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions github-actions-flask-deploy/.github/workflows/flask-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Flask CI/CD

on:
push:
branches: [ main ]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @davmano, I appreciate your interested on this project. this PR looks good to me, just one comment about the auto trigger event.
This would trigger and run the pipeline every push on main even if it's not related to the github-actions-flask-deploy project. Can you please add the filter on this push to only run when there has any change in the github-actions-flask-deploy folder only. Thanks.


jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run tests (placeholder)
run: |
echo "No tests defined."

- name: Deploy (placeholder)
run: |
echo "App would deploy here (e.g., to Heroku, Render, EC2, etc)"

34 changes: 34 additions & 0 deletions github-actions-flask-deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# GitHub Actions CI/CD Example – Flask App

This example shows how to automate testing and deployment of a simple Flask application using GitHub Actions.

## 📁 Structure

- `app.py`: Basic Flask web app
- `requirements.txt`: Dependencies
- `.github/workflows/flask-deploy.yml`: CI/CD pipeline

## 🚀 GitHub Actions Workflow

Triggered on every push to `main`:

1. Checkout code
2. Set up Python
3. Install dependencies
4. (Placeholder) Run tests
5. (Placeholder) Deploy app

## 🔧 Deployment

This example includes a placeholder deploy step. You can customize it to:

- Deploy to EC2 via SSH
- Push to Heroku
- Use Docker + AWS ECS

## ✅ Getting Started Locally

```bash
pip install -r requirements.txt
python app.py

9 changes: 9 additions & 0 deletions github-actions-flask-deploy/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from flask import Flask

app = Flask(__name__)

@app.route('/')
def index():
return "Hello From Github Actions CI/CD Pipeline!"


1 change: 1 addition & 0 deletions github-actions-flask-deploy/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
flask