Skip to content

Deploy to Servers

Deploy to Servers #321

Workflow file for this run

#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: 0
- name: SFTP Deploy
uses: wlixcc/[email protected]
with:
username: u-220216407
server: cs2410-web01pvm.aston.ac.uk
port: 22 # default is 22
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
local_paths: |
./public_html
./WoodLess
# files will copy to under remote_path
remote_path: ./
# sftp args
args: '-o ConnectTimeout=5'