Table of Contents

Flask API Project GitHub Integration

Overview

This section outlines the steps to integrate the Python Flask API project with GitHub and manage the deployment workflow.

Steps

  1. Associate VS Code with GitHub:
    1. Install VS Code if it is not already installed.
    2. Install the GitHub Pull Requests and Issues extension in VS Code.
    3. Authenticate your GitHub account with VS Code. This typically involves generating a Personal Access Token (PAT) from GitHub and adding it to VS Code.
  1. Workflow:
    1. Make changes to your files in VS Code.
    2. Commit those changes to the appropriate branch (e.g., `develop/staging` or `release`).
    3. Push your changes to the GitHub repository. If working on `master`, your files will be updated in the `master` branch.

Synchronizing Your Local Git Folder with GitHub

1. Initialize the Git Repository

    cd C:\Users\unapa\OneDrive\Documentos\git
    
    git init
    

2. Stage and Commit Your Files

    git status
    
    git add .
    
    git commit -m "Initial commit"
    

3. Connect to Your GitHub Repository

    git remote add origin https://github.com/fipharraguerre/git.git
    
    git remote -v
    

4. Push Your Local Commits to GitHub

    git push -u origin main
    

5. Verify the Changes on GitHub

Now your local project is synchronized with your GitHub repository! From here on, you can make changes to your files, commit them, and push them to GitHub.


  1. Deploying to the Staging Server:
    1. Set up a Git hook or a Continuous Integration/Continuous Deployment (CI/CD) pipeline to automatically pull changes from the `staging` branch onto your server.
    2. Use tools like GitHub Actions, Jenkins, or a cron job to automate this process.
  1. Containerization and Production:
    1. Once everything is validated on the staging server, merge the changes into the `release` branch.
    2. The `release` branch can trigger a Docker build process, creating a container for the Flask app.

Notes

This setup allows for safe development and testing in the staging environment before deploying a containerized version in production.