forked from infinitystation/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 69
43 lines (38 loc) · 1.21 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
name: Deploy
concurrency:
group: deploy
on:
workflow_dispatch:
inputs:
# ci_required:
# description: 'CI Suite is required'
# type: boolean
# required: true
# default: true
perform_deploy_sierra:
description: 'Deploy Sierra'
type: boolean
required: true
default: true
jobs:
# CI:
# uses: ./.github/workflows/ci.yml # use the callable tests job to run tests
# if: ${{ inputs.ci_required }}
deploy-sierra:
name: Deploy Sierra
runs-on: ubuntu-latest
# needs: [CI]
if: always() && !cancelled() && !failure() && inputs.perform_deploy_sierra
steps:
- name: Update and Build Sierra
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PRODUCTION_HOST }}
username: ${{ secrets.PRODUCTION_USERNAME }}
key: ${{ secrets.PRODUCTION_SSH_KEY }}
passphrase: ${{ secrets.PRODUCTION_SSH_KEY_PASS }}
script: |
TIME=$(date +'%Y-%m-%d%T')
sudo systemctl --wait start deploy-sierra
journalctl --since $TIME -u deploy-sierra --no-pager --all
systemctl is-failed deploy-sierra | grep -q "failed" && echo "Deployment Failed!" && exit 1 || exit 0