File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88
99jobs :
1010 build-and-test :
11- runs-on : ubuntu-latest
11+ # Run on self-hosted runner inside the VPC
12+ runs-on : [self-hosted, linux]
1213 steps :
1314 - name : Checkout code
1415 uses : actions/checkout@v3
@@ -21,25 +22,13 @@ jobs:
2122 - name : Install dependencies
2223 run : npm install
2324
24- - name : Set up SSH key
25- run : |
26- echo "${{ secrets.EC2_KEY }}" > ec2_key.pem
27- chmod 600 ec2_key.pem
28-
29- - name : Start SSH tunnel to RDS
30- run : |
31- ssh -i ec2_key.pem -o StrictHostKeyChecking=no -N -L 5432:${{ secrets.DB_HOST }}:5432 ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} &
32- echo "SSH tunnel started"
33-
34- - name : Wait for tunnel
35- run : sleep 5
36-
3725 - name : Run tests
3826 env :
39- DB_HOST : localhost
27+ DB_HOST : ${{ secrets.DB_HOST }} # RDS private endpoint
4028 DB_USER : ${{ secrets.DB_USER }}
4129 DB_PASSWORD : ${{ secrets.DB_PASSWORD }}
4230 DB_NAME : ${{ secrets.DB_NAME }}
31+ DB_PORT : ${{ secrets.DB_PORT }}
4332 run : npm test || echo "Skipping tests temporarily"
4433
4534 deploy :
You can’t perform that action at this time.
0 commit comments