fix: update deploy vars/secrets #7
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: Toolforge Deploy | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| jobs: | |
| deploy: | |
| name: Deploy to Toolforge | |
| runs-on: ubuntu-latest | |
| strategy: | |
| max-parallel: 4 | |
| matrix: | |
| tool: ["editgroups"] | |
| steps: | |
| - name: Configure SSH key | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | |
| - name: Run deployment commands | |
| uses: appleboy/[email protected] | |
| with: | |
| host: ${{ vars.SSH_HOST }} | |
| username: ${{ secrets.SSH_USER }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| port: ${{ vars.SSH_PORT }} | |
| request_pty: true | |
| script: | | |
| set -xe | |
| become ${{ matrix.tool }} git -C '$HOME/www/python/src' pull origin master | |
| become ${{ matrix.tool }} webservice python3.11 shell -- webservice-python-bootstrap | |
| become ${{ matrix.tool }} webservice python3.11 shell -- '$HOME/www/python/venv/bin/python' '$HOME/www/python/src/manage.py' migrate | |
| become ${{ matrix.tool }} webservice python3.11 shell -- '$HOME/www/python/venv/bin/python' '$HOME/www/python/src/manage.py' collectstatic --noinput | |
| become ${{ matrix.tool }} webservice python3.11 restart | |
| become ${{ matrix.tool }} webservice python3.11 status | |
| become ${{ matrix.tool }} ./www/python/src/restart_listener.sh | |
| become ${{ matrix.tool }} ./www/python/src/restart_celery.sh |