-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (50 loc) · 2.04 KB
/
deploy.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
50
name: Deploy on server
on:
workflow_dispatch:
inputs:
envname:
type: choice
description: Environnement
options:
- TEST
- PREPROD
- PROD
required: true
jobs:
build:
name: Build
runs-on: ubuntu-latest
environment: ${{github.event.inputs.envname}}
# surtout ne pas oublier d'ajouter CASignatureAlgorithms +ssh-rsa dans /etc/ssh_config
# et de faire un cat ~/.ssh/id_rsa.pub >> authorized_keys
steps:
- name: executing remote ssh commands using password
uses: appleboy/[email protected]
env:
POSTGRES_HOST: ${{secrets.POSTGRES_HOST}}
POSTGRES_PORT: ${{secrets.POSTGRES_PORT}}
POSTGRES_DB: ${{secrets.POSTGRES_DB}}
POSTGRES_USER: ${{secrets.POSTGRES_USER}}
POSTGRES_PASSWORD: ${{secrets.POSTGRES_PASSWORD}}
JWT_SECRET: ${{secrets.JWT_SECRET}}
JWT_EXPIRE: ${{secrets.JWT_EXPIRE}}
MONITORING_PASSWORD: ${{secrets.MONITORING_PASSWORD}}
MONITORING_USER: ${{secrets.MONITORING_USER}}
with:
host: ${{ secrets.HOSTNAME }}
debug: true
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
envs: POSTGRES_HOST,POSTGRES_PORT,POSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORD,JWT_SECRET,JWT_EXPIRE,MONITORING_PASSWORD,MONITORING_USER
script: |
export POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}
export POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}
export POSTGRES_PORT=${{ secrets.POSTGRES_PORT}}
export POSTGRES_DB=${{ secrets.POSTGRES_DB }}
export POSTGRES_USER=${{ secrets.POSTGRES_USER }}
export JWT_SECRET=${{ secrets.JWT_SECRET }}
export JWT_EXPIRE=${{ secrets.JWT_EXPIRE }}
export MONITORING_PASSWORD=${{secrets.MONITORING_PASSWORD}}
export MONITORING_USER=${{secrets.MONITORING_USER}}
cd /home/dngconsulting/OpenDossard && source od.sh goprod