Skip to content

Commit d23896e

Browse files
committed
build: CD to Toolforge
1 parent ccbe2c3 commit d23896e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Toolforge Deploy
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
6+
jobs:
7+
deploy:
8+
name: Deploy to Toolforge
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
max-parallel: 4
13+
matrix:
14+
tool: ["editgroups", "editgroups-commons"]
15+
16+
steps:
17+
- name: Configure SSH key
18+
uses: shimataro/ssh-key-action@v2
19+
with:
20+
key: ${{ secrets.SSH_PRIVATE_KEY }}
21+
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
22+
23+
- name: Run deployment commands
24+
uses: appleboy/[email protected]
25+
with:
26+
host: ${{ secrets.SSH_HOST }}
27+
username: ${{ secrets.SSH_USER }}
28+
key: ${{ secrets.SSH_PRIVATE_KEY }}
29+
port: ${{ secrets.PORT }}
30+
request_pty: true
31+
script: |
32+
set -xe
33+
become ${{ matrix.tool }} git -C '$HOME/www/python' pull
34+
become ${{ matrix.tool }} webservice python3.11 shell -- webservice-python-bootstrap
35+
become ${{ matrix.tool }} webservice python3.11 shell -- '$HOME/www/python/venv/bin/python' '$HOME/www/python/src/manage.py' migrate
36+
become ${{ matrix.tool }} webservice python3.11 shell -- '$HOME/www/python/venv/bin/python' '$HOME/www/python/src/manage.py' collectstatic --noinput
37+
become ${{ matrix.tool }} webservice python3.11 restart
38+
become ${{ matrix.tool }} webservice python3.11 status
39+
become ${{ matrix.tool }} ./www/python/src/restart_listener.sh
40+
become ${{ matrix.tool }} ./www/python/src/restart_celery.sh

0 commit comments

Comments
 (0)