refactor most shorted stocks #603
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Backend CI/CD | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/[email protected] | |
with: | |
python-version: '3.x' | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build-and-test | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: SSH and Restart EU Server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.EU_IP_ADDRESS }} | |
username: ${{ secrets.EU_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd backend/ | |
git reset --hard | |
git pull https://${{ secrets.GIT_PASSWORD }}:[email protected]/stocknear/backend.git | |
pm2 restart fastapi | |
pm2 restart fastify | |
- name: SSH and Restart USEast Server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.USEAST_IP_ADDRESS }} | |
username: ${{ secrets.USEAST_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
cd backend/ | |
git reset --hard | |
git pull https://${{ secrets.GIT_PASSWORD }}:[email protected]/stocknear/backend.git | |
pm2 restart fastapi | |
pm2 restart fastify | |
- name: Actions for Discord | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
uses: Ilshidur/[email protected] | |
with: | |
args: '${{ github.event.repository.full_name }} has been deployed successfully.' |