-
Notifications
You must be signed in to change notification settings - Fork 4
40 lines (36 loc) · 1.51 KB
/
toolforge-deploy.yml
File metadata and controls
40 lines (36 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Toolforge Deploy
on:
push:
branches: [ "master" ]
jobs:
deploy:
name: Deploy to Toolforge
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
tool: ["editgroups", "editgroups-commons"]
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/ssh-action@v1.0.3
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 ./www/python/src pull origin master
become ${{ matrix.tool }} webservice --mem 512Mi python3.11 shell -- webservice-python-bootstrap
become ${{ matrix.tool }} webservice --mem 512Mi python3.11 shell -- ./www/python/venv/bin/python ./www/python/src/manage.py migrate
become ${{ matrix.tool }} webservice --mem 512Mi python3.11 shell -- ./www/python/venv/bin/python ./www/python/src/manage.py collectstatic --noinput
become ${{ matrix.tool }} webservice python3.11 stop
become ${{ matrix.tool }} webservice python3.11 start --cpu 2 --mem 3Gi
become ${{ matrix.tool }} webservice python3.11 status
become ${{ matrix.tool }} ./www/python/src/restart_celery.sh