updating static location #9
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 Django to Lightsail | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| name: Deploy to Lightsail | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Copy files to Lightsail using SSH | |
| uses: appleboy/scp-action@v0.1.7 | |
| with: | |
| host: ${{ secrets.LIGHTSAIL_HOST }} | |
| username: ${{ secrets.LIGHTSAIL_USER }} | |
| key: ${{ secrets.LIGHTSAIL_SSH_KEY }} | |
| port: 22 | |
| source: "." | |
| target: ${{ github.event.repository.name }} | |
| - name: Run deployment commands on Lightsail | |
| uses: appleboy/ssh-action@v1.0.3 | |
| with: | |
| host: ${{ secrets.LIGHTSAIL_HOST }} | |
| username: ${{ secrets.LIGHTSAIL_USER }} | |
| key: ${{ secrets.LIGHTSAIL_SSH_KEY }} | |
| port: 22 | |
| script: | | |
| cd ${{ github.event.repository.name }} | |
| pip install -r requirements.txt | |
| sudo supervisorctl reread | |
| sudo supervisorctl update | |
| sudo supervisorctl restart all |