Skip to content

Commit

Permalink
Merge pull request #586 from hngprojects/fix-workflows
Browse files Browse the repository at this point in the history
change scp .env step
  • Loading branch information
Rob-in-son authored Aug 10, 2024
2 parents b2d60bf + 659af2d commit 82c5ce0
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
# - name: Fetch .env file from server
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.HOST }}
# username: ${{ secrets.USERNAME }}
# password: ${{ secrets.PASSWORD }}
# source: "/var/www/aihomework/dev/.env"
# target: ".env"

- name: Install sshpass
run: sudo apt-get install sshpass

- name: Fetch .env file from server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "/var/www/aihomework/dev/.env"
target: ".env"
run: |
sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/var/www/aihomework/dev/.env .env
env:
SSH_HOST: ${{ secrets.HOST }}
SSH_USERNAME: ${{ secrets.USERNAME }}
SSH_PASSWORD: ${{ secrets.PASSWORD }}

- name: Build Docker images
run: |
Expand Down

0 comments on commit 82c5ce0

Please sign in to comment.