-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (59 loc) · 1.98 KB
/
main.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#name: CI-SFTP
name: Deploy to Servers
# Controls when the action will run.
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Additional trigger for increased verbosity
workflow_run:
workflows: [Run Tests]
branches:
- main
types:
- completed
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check-test-results:
runs-on: ubuntu-latest
steps:
- name: Check Test Failure
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
run: |
echo 'Tests have failed.'
exit 1
- name: Check Test Success
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: |
echo 'Tests were successful.'
deploy-server-1:
needs:
[check-test-results]
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: SFTP Deploy
uses: SamKirkland/[email protected]
with:
server: 159.255.146.250
username: woodless
password: ${{ secrets.FTP_PASSWORD }}
deploy-server-2:
needs:
[check-test-results]
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
fetch-depth: 2
- name: SFTP Deploy
uses: SamKirkland/[email protected]
with:
server: [email protected]
port: 22
password: ${{ secrets.UNI_SERVER_PASSWORD }}