Merge pull request #1247 from hngprojects/dependabot/pip/aiohttp-3.10.11 #62
This file contains hidden or 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: Development Branch Deployment | |
| on: | |
| push: | |
| branches: [dev] | |
| paths-ignore: | |
| - "README.md" | |
| - ".github/workflows/**" | |
| workflow_dispatch: | |
| jobs: | |
| on-success: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Archive application build | |
| run: | | |
| mkdir app | |
| cp -r alembic api qa_tests scripts tests requirements.txt *.py alembic.ini app | |
| tar -czf python-dev.tar.gz app | |
| - name: Copy Artifacts to server | |
| run: | | |
| sshpass -p ${{ secrets.PASSWORD }} scp -o StrictHostKeyChecking=no python-dev.tar.gz ${{ secrets.USERNAME }}@${{ secrets.HOST }}:/tmp/python | |
| rm -f python-dev.tar.gz | |
| - name: Use SSH Action | |
| uses: appleboy/ssh-action@v0.1.8 | |
| with: | |
| host: ${{ secrets.HOST }} | |
| username: ${{ secrets.USERNAME }} | |
| password: ${{ secrets.PASSWORD }} | |
| script: | | |
| cd boilerplate/python/dev | |
| tar -xzf /tmp/python/python-dev.tar.gz -C . | |
| rm -f /tmp/python/python-dev.tar.gz | |
| cp .env app/.env | |
| source venv/bin/activate | |
| cd app | |
| pip install -r requirements.txt | |
| alembic revision --autogenerate | |
| alembic upgrade head | |
| cd .. | |
| pm2 restart dev-ecosystem.config.js || pm2 start dev-ecosystem.config.js |