-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (81 loc) · 3.11 KB
/
main.yml
File metadata and controls
89 lines (81 loc) · 3.11 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: CI/CD Settings (DII)
on:
push:
branches:
- deploy-production
jobs:
# slack-notification-start:
# name: Slack Notification (Start)
# runs-on: ubuntu-latest
# if: ${{ !contains(github.event.head_commit.message, '#skip_notification') }}
# steps:
# - name: Notification
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: development
# SLACK_COLOR: 1BA9FF
# SLACK_ICON: https://dii.alphacapture.xyz/assets/img/logo.png
# SLACK_MESSAGE: Deploying the DII site...
# SLACK_TITLE: Deploy Notification
# SLACK_USERNAME: Deploy Notification
# SLACK_FOOTER: Powered by AlphaCapture Team
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
deploy:
name: SSH Connection
runs-on: ubuntu-latest
steps:
- name: SSH Connection
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_RSA_PRIVATE_KEY }}
port: 22
command_timeout: 500m
script: |
sudo docker system prune --force
sudo rm -rf D2
sudo git clone https://${{ secrets.REPO_TOKEN }}@github.com/AlphaCaptureXYZ/D2.git
cd D2
sudo git checkout deploy-production
sudo sh ./scripts/pull_spinup-live.sh
# slack-notification-finish:
# name: Slack Notification (Finish)
# needs: deploy
# runs-on: ubuntu-latest
# if: ${{ !contains(github.event.head_commit.message, '#skip_notification') }}
# steps:
# - name: Notification
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: development
# SLACK_COLOR: ${{ job.status }}
# SLACK_ICON: https://dii.alphacapture.xyz/assets/img/logo.png
# SLACK_MESSAGE: DII site deployed, check the status from the Actions URL section.
# SLACK_TITLE: Deploy Notification
# SLACK_USERNAME: Deploy Notification
# SLACK_FOOTER: Powered by AlphaCapture Team
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
# slack-notification-error:
# name: Slack Notification (Error)
# runs-on: ubuntu-latest
# if: ${{
# failure() &&
# !contains(github.event.head_commit.message, '#skip_notification')
# }}
# steps:
# - name: Notification
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: development
# SLACK_COLOR: E13F31
# SLACK_ICON: https://d2.alphacapture.xyz/assets/img/logo.png
# SLACK_MESSAGE: The DII site was not deployed (¡error!), check the status from the Actions URL section to see and solve the error.
# SLACK_TITLE: Deploy Notification
# SLACK_USERNAME: Deploy Notification
# SLACK_FOOTER: Powered by AlphaCapture Team
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}