feat: update test environment setup to include secret key and refresh token expiry
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m2s
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m2s
This commit is contained in:
@@ -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***/'
|
||||
|
||||
Reference in New Issue
Block a user