feat: Add pre-production deployment stage with E2E tests, a dedicated environment file, and update production deployment dependency.
All checks were successful
Remote Deployment Pipeline / Prepare Context (pull_request) Successful in 2s
Remote Deployment Pipeline / Deploy (Staging) (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Dev/Preview) (pull_request) Successful in 1m33s
Remote Deployment Pipeline / Cleanup Preview (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Pre-Prod) (pull_request) Has been skipped
Remote Deployment Pipeline / Deploy (Production) (pull_request) Has been skipped

This commit is contained in:
2026-01-15 21:17:40 +01:00
parent b448b47b70
commit 7121747d35
2 changed files with 48 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ env:
REMOTE_DEPLOY_PATH: /var/app/traefik/test
REMOTE_PROD_PATH: /var/app/traefik/prod
REMOTE_STAGING_PATH: /var/app/traefik/staging
REMOTE_PREPROD_PATH: /var/app/traefik/preprod
# --- SECRETS ---
SSH_HOST: ${{ secrets.SSH_HOST }}
@@ -93,13 +94,50 @@ jobs:
cd ${{ env.REMOTE_STAGING_PATH }}
docker compose --env-file staging.env -f docker-compose.yaml up -d --build --remove-orphans --wait
# ------------------------------------------------------------------
# STAGE 3.5: DEPLOY PRE-PROD
# ------------------------------------------------------------------
deploy_preprod:
name: Deploy (Pre-Prod)
runs-on: ubuntu-latest
needs: [deploy_staging]
if: github.ref == 'refs/heads/test_preprod'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- name: Deploy via Rsync & Docker
uses: easingthemes/ssh-deploy@a1aa0b6cf96ce2406eef90faa35007a4a7bf0ac0 # v5.1.1
env:
SSH_PRIVATE_KEY: ${{ env.SSH_PRIVATE_KEY }}
REMOTE_HOST: ${{ env.SSH_HOST }}
REMOTE_USER: ${{ env.SSH_USER }}
REMOTE_PORT: ${{ env.SSH_PORT }}
TARGET: ${{ env.REMOTE_PREPROD_PATH }}
EXCLUDE: ".git/, .github/"
SCRIPT_BEFORE: |
mkdir -p ${{ env.REMOTE_PREPROD_PATH }}
SCRIPT_AFTER: |
set -e
cd ${{ env.REMOTE_PREPROD_PATH }}
docker compose --env-file preprod.env -f docker-compose.yaml -f docker-compose.prod.yaml up -d --build --remove-orphans --wait
# Run E2E Tests
echo "Running E2E tests..."
# Create venv to avoid polluting system python
python3 -m venv .venv
. .venv/bin/activate
pip install -r tests/e2e/requirements.txt
pytest tests/e2e/
docker compose --env-file preprod.env -f docker-compose.yaml -f docker-compose.prod.yaml down --remove-orphans
# ------------------------------------------------------------------
# STAGE 4: DEPLOY PRODUCTION
# ------------------------------------------------------------------
deploy_prod:
name: Deploy (Production)
runs-on: ubuntu-latest
needs: [deploy_staging]
needs: [deploy_preprod]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

9
preprod.env Normal file
View File

@@ -0,0 +1,9 @@
PORT=8081
HTTPS_PORT=447
ENV=preprod
NETWORK_NAME=proxy
CERTBOT_CA_RESOLVER=https://acme-staging-v02.api.letsencrypt.org/directory
DOMAIN=preprod.kovagoadi.hu
ACME_BYPASS=false
TRAEFIK_LEGACY_OPT="--providers.file.directory=/etc/traefik"
CI=true