Added sample deploy action

This commit is contained in:
Théo DURR 2022-08-26 13:20:57 +02:00
parent 273371db8b
commit 6e4a99eba3
No known key found for this signature in database
GPG Key ID: 708858E9F7281E30
3 changed files with 33 additions and 15 deletions

View File

@ -1,21 +1,29 @@
name: Deploy to production
on:
workflow_run:
workflows: [Unit Testing]
types: [completed]
branches:
- master
push:
branches: [ actions ]
workflow_dispatch:
jobs:
on-success:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo 'The triggering workflow passed'
- name: SSH Remote Commands
uses: appleboy/ssh-action@v0.1.5
with:
# Proxy
proxy_host : ${{secrets.PROXY_HOST}}
proxy_port : ${{secrets.PROXY_PORT}}
proxy_username : ${{secrets.PROXY_USERNAME}}
proxy_passphrase: ${{secrets.PROXY_PASSPHRASE}}
proxy_key: ${{secrets.PROXY_KEY}}
# Serveur web
host: ${{secrets.HOST}}
port : ${{secrets.PORT}}
username : ${{secrets.USERNAME}}
key: ${{secrets.KEY}}
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The triggering workflow failed'
script: whoami

View File

@ -1,6 +1,11 @@
name: Unit Testing
on: [push]
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
unittests:
runs-on: ubuntu-latest

View File

@ -1,6 +1,11 @@
name: Unit Testing
on: [push]
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
unittests:
runs-on: ubuntu-latest