generated from dataforgoodfr/d4g-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (34 loc) · 1.21 KB
/
cicd_dev.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
name: Copy website to the development site
on:
push:
branches:
- cicd_dev
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
copy:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install and start the ssh agent
run: |
which ssh-agent || ( apt-get install -qq openssh-client )
eval $(ssh-agent -s)
- name: Read the ssh private key
env:
SSH_SECRET_KEY: ${{ secrets.SSH_SECRET_KEY }}
run: |
eval $(ssh-agent -s)
ssh-add <(echo "$SSH_SECRET_KEY" | base64 --decode)
- name: Definition of the known host
run: |
mkdir -p ~/.ssh/
# ssh-keyscan 129.199.194.59 > .deploy/known_host
mv .deploy/known_hosts ~/.ssh/
chmod 644 ~/.ssh/known_hosts
- name: Synchronization of the remote deployment
run: |
ssh d4gtaxobs@129.199.194.59 "sudo service taxplorer-dev.uwsgi stop"
#ssh d4gtaxobs@129.199.194.59 "cd /opt/d4g/12_taxobservatory_dataviz_dev && git pull"
ssh d4gtaxobs@129.199.194.59 "sudo service taxplorer-dev.uwsgi start"