From c3538cc3d4c59a5f84a14eee16b8fcd97e4987dd Mon Sep 17 00:00:00 2001 From: Ryan Kegel Date: Sun, 1 Mar 2026 21:15:19 -0500 Subject: [PATCH] feat: update test environment setup to include secret key and refresh token expiry --- .gitea/workflows/build.yaml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 4cc0fa2..f92a3d5 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -119,24 +119,34 @@ jobs: - name: Deploy Test Environment if: gitea.ref == 'refs/heads/next' - uses: appleboy/ssh-action@v1.0.3 # Or equivalent Gitea action; adjust version if needed + uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.DEPLOY_TEST_HOST }} username: ${{ secrets.DEPLOY_TEST_USER }} key: ${{ secrets.SSH_PRIVATE_KEY }} - port: 22 # Default SSH port; change if different + port: 22 script: | cd /tmp - # Pull the repository to get the latest docker-compose.dev.yml if [ -d "chore" ]; then cd chore - git pull origin next || true # Pull latest changes; ignore if it fails (e.g., first run) + git pull origin next || true else git clone --branch next https://git.ryankegel.com/ryan/chore.git cd chore fi + + export SECRET_KEY="${{ secrets.SECRET_KEY }}" + export REFRESH_TOKEN_EXPIRY_DAYS="1" + + echo "SECRET_KEY is set: $([ -n "$SECRET_KEY" ] && echo YES || echo NO)" + echo "REFRESH_TOKEN_EXPIRY_DAYS: $REFRESH_TOKEN_EXPIRY_DAYS" + echo "Bringing down previous test environment..." docker-compose -f docker-compose.test.yml down --volumes --remove-orphans || true echo "Starting new test environment..." - docker-compose -f docker-compose.test.yml pull # Ensure latest images are pulled - SECRET_KEY=${{ secrets.SECRET_KEY }} REFRESH_TOKEN_EXPIRY_DAYS=1 docker-compose -f docker-compose.test.yml up -d + docker-compose -f docker-compose.test.yml pull + docker-compose -f docker-compose.test.yml up -d + + echo "Verifying container received env vars..." + sleep 3 + docker exec chores-test-app-backend env | grep -E "SECRET_KEY|REFRESH_TOKEN" | sed 's/SECRET_KEY=.*/SECRET_KEY=***REDACTED***/'