tech: set env for github action deploy-to-scaleway #5
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: Deploy to Scaleway | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.ref_name }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| - name: Set up SSH | |
| uses: webfactory/ssh-agent@v0.5.3 | |
| with: | |
| ssh-private-key: ${{ secrets.SCW_SSH_KEY }} | |
| - name: Deploy to Scaleway | |
| env: | |
| SCW_HOST: ${{ secrets.SCW_HOST }} | |
| SCW_USER: ${{ secrets.SCW_USER }} | |
| run: | | |
| ssh -o StrictHostKeyChecking=no $SCW_USER@$SCW_HOST << 'EOF' | |
| cd /opt/apps/aigle-api | |
| git pull origin develop | |
| source venv/bin/activate | |
| pip install -r requirements.txt | |
| python manage.py migrate | |
| sudo systemctl restart gunicorn_aigle | |
| EOF |