Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit

Permalink
chore: add scp in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amber committed Sep 30, 2024
1 parent bf2cc26 commit 037230a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,19 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v4

- name: SSH into EC2 and deploy
uses: appleboy/scp-action@v0.1.7
with:
host: ${{ secrets.EC2_USER }}
username: ${{ secrets.EC2_USER }}
key: ${{ secrets.EC2_SSH_KEY }}
source: "docker-compose.yaml, init/*"
target: "/home/ubuntu"

- name: SSH into EC2 to run Docker Compose
run: |
echo "${{ secrets.EC2_SSH_KEY }}" > private_key && chmod 600 private_key
ssh -i private_key -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_PUBLIC_IP }} << 'EOF'
#git clone https://github.com/SE-Row-1/nus-secondhand-market.git
#cd nus-secondhand-market
#git checkout setup-infra2
echo "POSTGRES_USERNAME=${{ secrets.POSTGRES_USERNAME }}" > .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "POSTGRES_URL=${{ secrets.POSTGRES_URL }}" >> .env
Expand Down

0 comments on commit 037230a

Please sign in to comment.