Skip to content

Commit

Permalink
Merge pull request #44 from DevDataPlatform/deploy-ec2
Browse files Browse the repository at this point in the history
update workflows
  • Loading branch information
fatchat authored Aug 17, 2023
2 parents ce25626 + c939fa3 commit 821a0e3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,25 @@ jobs:
- name: Create logs directory
run: |
mkdir -p logs
echo "LOGDIR=logs" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Create known_hosts file
run: |
mkdir -p ~/.ssh
touch ~/.ssh/known_hosts
- name: Add remote host key to known_hosts
run: ssh-keyscan ${{ secrets.SERVERIP }} >> ~/.ssh/known_hosts
- name: Create Google App credentials file
run: |
echo '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_JSON }}' > /tmp/google_credentials.json
- name: Test with pytest
env:
GOOGLE_APPLICATION_CREDENTIALS: /tmp/google_credentials.json
LOGDIR: ${{ github.workspace }}/logs
run: |
mkdir -p $LOGDIR
coverage run -m pytest
coverage report --fail-under=70
coverage xml
Expand All @@ -49,4 +56,9 @@ jobs:
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
fail_ci_if_error: true
- name: Deploy to EC2
run: |
eval `ssh-agent -s`
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
ssh ${{ secrets.SERVER }} "source ~/.nvm/nvm.sh; cd /home/ddp/prefect-proxy; git pull; pm2 restart prefect-proxy"

0 comments on commit 821a0e3

Please sign in to comment.