-
Notifications
You must be signed in to change notification settings - Fork 17
49 lines (42 loc) · 1.35 KB
/
actinos_workflow.yml
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
41
42
43
44
45
46
47
48
49
name: Deployment Workflow
on:
push:
branches: [main]
jobs:
first_job:
name: Deploy Calliar Website
runs-on: ubuntu-latest
steps:
- name: SSH Remote Commands
uses: appleboy/[email protected]
with:
host: calliar.arbml.org
username: arabicmachinelearning
key: ${{ secrets.SECRET_SSHKEY }}
port: 22
script: |
cd ~
if [ ! -d "atmatah" ];
then
echo cloning atamatah as it does not exist
git clone https://github.com/ARBML/atmatah.git
cd atmatah
else
echo pulling latest changes from atmatah
cd atmatah
git pull
fi
echo creating venv if not exist and install requirements
if [ ! -d "venv" ];
then
python3 -m venv venv
fi
venv/bin/python3 -m pip install -r requirements.txt
venv/bin/ansible-galaxy install -r requirements.yml
echo prepare for deploy
mkdir -p .config
echo ${{ secrets.ANS_PASS }} > .config/ansible_pass.password
echo deploy calliar app
venv/bin/ansible-playbook -i apps/calliar/inventory apps/calliar/app.yml --vault-password-file=.config/ansible_pass.password --connection=local
echo cleanup
cd ~