forked from Islandora-Devops/isle-dc
-
Notifications
You must be signed in to change notification settings - Fork 6
62 lines (54 loc) · 1.66 KB
/
deploy_test.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
name: Deploy and Rollback
on:
push:
branches:
- community_version
workflow_dispatch:
inputs:
action:
description: 'Action (deploy/latest or rollback)'
required: true
default: 'deploy/latest'
jobs:
build-and-deploy:
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'deploy/latest')
name: build and deploy
runs-on:
- self-hosted
- testing
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build JHU Image
run: make jhu_up
- name: Add demo content
run: make jhu_demo_content
- name: Notify Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()
rollback:
if: github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'rollback'
name: rollback
runs-on:
- self-hosted
- testing
steps:
# Add steps here for rolling back your deployment, e.g.:
- name: Checkout previous version
uses: actions/checkout@v3
with:
ref: ${{ github.event.before }}
# ... additional rollback steps ...
- name: Notify Slack
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took,pullRequest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
if: failure()