Create .gitea/workflows/deploy-production.yml #82

Closed
opened 2026-01-17 21:53:44 +00:00 by lmiranda · 0 comments
Owner

Overview

Create a Gitea Actions workflow for automated deployment to the production environment when code is pushed to the main branch.

Acceptance Criteria

  • Create .gitea/workflows/deploy-production.yml
  • Trigger on push to main branch
  • Deploy target: production VPS via secrets.PROD_HOST
  • Deployment steps (identical to staging):
    • SSH into production using secrets
    • Pull latest code from main branch
    • Activate Python virtual environment
    • Run pip install -r requirements.txt
    • Run dbt run to update models
    • Run docker compose restart to restart services
  • Use production-specific secrets
  • Add appropriate error handling and notifications
  • Consider adding deployment confirmation/approval step

Technical Notes

Required Gitea secrets:

  • PROD_SSH_KEY - Private SSH key for production
  • PROD_HOST - Production server hostname/IP
  • PROD_USER - SSH username

Workflow should mirror staging but with production secrets:

name: Deploy Production
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to production
        uses: appleboy/ssh-action@v1
        with:
          host: ${{ secrets.PROD_HOST }}
          username: ${{ secrets.PROD_USER }}
          key: ${{ secrets.PROD_SSH_KEY }}
          script: |
            cd ~/personal-portfolio
            git pull origin main
            source .venv/bin/activate
            pip install -r requirements.txt
            dbt run
            docker compose restart

Labels

  • Type/Feature
  • Priority/High
  • Complexity/Medium
  • Component/Deploy
  • Component/Infra

Phase: 2 - CI/CD

## Overview Create a Gitea Actions workflow for automated deployment to the production environment when code is pushed to the main branch. ## Acceptance Criteria - [ ] Create `.gitea/workflows/deploy-production.yml` - [ ] Trigger on push to `main` branch - [ ] Deploy target: production VPS via `secrets.PROD_HOST` - [ ] Deployment steps (identical to staging): - [ ] SSH into production using secrets - [ ] Pull latest code from main branch - [ ] Activate Python virtual environment - [ ] Run `pip install -r requirements.txt` - [ ] Run `dbt run` to update models - [ ] Run `docker compose restart` to restart services - [ ] Use production-specific secrets - [ ] Add appropriate error handling and notifications - [ ] Consider adding deployment confirmation/approval step ## Technical Notes Required Gitea secrets: - `PROD_SSH_KEY` - Private SSH key for production - `PROD_HOST` - Production server hostname/IP - `PROD_USER` - SSH username Workflow should mirror staging but with production secrets: ```yaml name: Deploy Production on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy to production uses: appleboy/ssh-action@v1 with: host: ${{ secrets.PROD_HOST }} username: ${{ secrets.PROD_USER }} key: ${{ secrets.PROD_SSH_KEY }} script: | cd ~/personal-portfolio git pull origin main source .venv/bin/activate pip install -r requirements.txt dbt run docker compose restart ``` ## Labels - Type/Feature - Priority/High - Complexity/Medium - Component/Deploy - Component/Infra ## Phase: 2 - CI/CD
Sign in to join this conversation.