Create .gitea/workflows/deploy-staging.yml #81

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 staging environment on hotserv when code is pushed to the staging branch.

Acceptance Criteria

  • Create .gitea/workflows/deploy-staging.yml
  • Trigger on push to staging branch
  • Deploy target: hotserv via Tailscale (100.82.122.98)
  • Deployment steps:
    • SSH into hotserv using secrets
    • Pull latest code from staging 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 SSH key authentication via Gitea secrets
  • Add appropriate error handling and notifications

Technical Notes

Required Gitea secrets:

  • STAGING_SSH_KEY - Private SSH key for hotserv
  • STAGING_HOST - Tailscale IP (100.82.122.98)
  • STAGING_USER - SSH username

Example workflow structure:

name: Deploy Staging
on:
  push:
    branches: [staging]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to staging
        uses: appleboy/ssh-action@v1
        with:
          host: ${{ secrets.STAGING_HOST }}
          username: ${{ secrets.STAGING_USER }}
          key: ${{ secrets.STAGING_SSH_KEY }}
          script: |
            cd ~/personal-portfolio
            git pull origin staging
            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 staging environment on hotserv when code is pushed to the staging branch. ## Acceptance Criteria - [ ] Create `.gitea/workflows/deploy-staging.yml` - [ ] Trigger on push to `staging` branch - [ ] Deploy target: hotserv via Tailscale (100.82.122.98) - [ ] Deployment steps: - [ ] SSH into hotserv using secrets - [ ] Pull latest code from staging 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 SSH key authentication via Gitea secrets - [ ] Add appropriate error handling and notifications ## Technical Notes Required Gitea secrets: - `STAGING_SSH_KEY` - Private SSH key for hotserv - `STAGING_HOST` - Tailscale IP (100.82.122.98) - `STAGING_USER` - SSH username Example workflow structure: ```yaml name: Deploy Staging on: push: branches: [staging] jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy to staging uses: appleboy/ssh-action@v1 with: host: ${{ secrets.STAGING_HOST }} username: ${{ secrets.STAGING_USER }} key: ${{ secrets.STAGING_SSH_KEY }} script: | cd ~/personal-portfolio git pull origin staging 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.