Deploy on server #131
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} | |
steps: | |
- name: executing remote ssh commands using password | |
uses: appleboy/ssh-action@v0.1.4 | |
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 }} | |
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 |