{"id":18234048,"url":"https://github.com/darshan12345678910/flask_application_with_githubactions","last_synced_at":"2026-01-29T09:39:31.260Z","repository":{"id":260325341,"uuid":"879684286","full_name":"darshan12345678910/flask_application_with_githubactions","owner":"darshan12345678910","description":"Simple Dockerized flask application with CI-CD githubaction","archived":false,"fork":false,"pushed_at":"2024-10-30T18:26:56.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T09:09:46.622Z","etag":null,"topics":["ci-cd","flask","github-actions","pytest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darshan12345678910.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-28T11:17:44.000Z","updated_at":"2024-10-30T18:33:41.000Z","dependencies_parsed_at":"2024-10-30T18:36:22.087Z","dependency_job_id":"44f8cacc-a23c-430a-9ff8-62385f8835ed","html_url":"https://github.com/darshan12345678910/flask_application_with_githubactions","commit_stats":null,"previous_names":["darshan12345678910/flask_application_with_githubactions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/darshan12345678910/flask_application_with_githubactions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshan12345678910%2Fflask_application_with_githubactions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshan12345678910%2Fflask_application_with_githubactions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshan12345678910%2Fflask_application_with_githubactions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshan12345678910%2Fflask_application_with_githubactions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darshan12345678910","download_url":"https://codeload.github.com/darshan12345678910/flask_application_with_githubactions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darshan12345678910%2Fflask_application_with_githubactions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28874051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T07:35:32.468Z","status":"ssl_error","status_checked_at":"2026-01-29T07:33:31.463Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci-cd","flask","github-actions","pytest"],"created_at":"2024-11-04T17:03:16.266Z","updated_at":"2026-01-29T09:39:31.243Z","avatar_url":"https://github.com/darshan12345678910.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask Application with GitHub Actions CI/CD\r\n\r\nThis project is a Dockerized Flask application that performs basic calculations. The app includes a CI/CD pipeline set up with GitHub Actions to automatically build, test, and push a Docker image to Docker Hub on each push or pull request to the main branch.\r\n\r\n## Features\r\n- Simple calculator app with addition, subtraction, multiplication, and division functions.\r\n- Dockerized setup for easy deployment.\r\n- CI/CD pipeline with GitHub Actions to ensure continuous integration and delivery.\r\n\r\n## Prerequisites\r\n\r\n1. **Docker**: Ensure Docker is installed and running on your machine.\r\n2. **GitHub Account**: Required for GitHub Actions setup.\r\n3. **Docker Hub Account**: Required to store the Docker image.\r\n\r\n## Setup and Installation\r\n\r\n1. **Clone the Repository**:\r\n   ```bash\r\n   git clone https://github.com/\u003cyour-username\u003e/flask_application_with_githubactions.git\r\n   cd flask_application_with_githubactions\r\n\r\n2. **Install Dependencies** (Optional for local testing):\r\n   - If you want to run the application locally without Docker, you can install the dependencies with:\r\n     ```bash\r\n     pip install -r requirements.txt\r\n     ```\r\n\r\n3. **Run the Application Locally**:\r\n   - You can start the Flask app by running:\r\n     ```bash\r\n     python app.py\r\n     ```\r\n   - The application should be accessible at `http://localhost:5000`.\r\n\r\n4. **Run Tests Locally**:\r\n   - To ensure everything is working correctly, run the tests:\r\n     ```bash\r\n     pytest\r\n     ```\r\n\r\n## Docker Usage\r\n\r\n1. **Build the Docker Image**:\r\n   ```bash\r\n   docker build -t flasktest-app .\r\n# CI/CD Pipeline with GitHub Actions\r\n\r\nThe `.github/workflows/main.yml` file defines the CI/CD pipeline, which is triggered on pushes and pull requests to the `main` branch.\r\n\r\n## Workflow Jobs\r\n\r\n### 1. `build_and_test`\r\n- **Description**: Checks out the repository, sets up Python, installs dependencies, and runs unit tests to verify the application's functionality.\r\n- **Steps**:\r\n  - Checks out the repository code.\r\n  - Sets up a Python environment.\r\n  - Installs project dependencies from `requirements.txt`.\r\n  - Runs unit tests using `pytest` to ensure code correctness.\r\n\r\n### 2. `build_and_push_docker`\r\n- **Description**: Builds and pushes the Docker image to Docker Hub. Requires Docker Hub credentials to be securely stored as GitHub secrets.\r\n- **Steps**:\r\n  - Builds the Docker image.\r\n  - Logs in to Docker Hub.\r\n  - Pushes the Docker image to your Docker Hub repository.\r\n\r\n## Setting Up GitHub Secrets\r\n\r\nTo allow GitHub Actions to authenticate with Docker Hub, you need to set up secrets in your GitHub repository.\r\n\r\n1. Go to your repository on GitHub.\r\n2. Navigate to **Settings** \u003e **Secrets** \u003e **Actions**.\r\n3. Add the following secrets:\r\n   - **DOCKER_HUB_USERNAME**: Your Docker Hub username.\r\n   - **DOCKER_HUB_PASSWORD**: Your Docker Hub password.\r\n\r\n## Triggering the Workflow\r\n\r\nThe CI/CD pipeline is triggered automatically in the following scenarios:\r\n- When you **push** changes to the `main` branch.\r\n- When you **open a pull request** targeting the `main` branch.\r\n\r\nThis setup ensures that the application is tested and deployed seamlessly, providing continuous integration and delivery.\r\n   \r\n\r\n   \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarshan12345678910%2Fflask_application_with_githubactions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarshan12345678910%2Fflask_application_with_githubactions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarshan12345678910%2Fflask_application_with_githubactions/lists"}