-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 2.3 KB
/
Copy pathserver-refresh.yml
File metadata and controls
68 lines (60 loc) · 2.3 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
name: Refresh server
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- dev
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
server-refresh:
name: Refresh server
runs-on: ubuntu-latest
if: contains(github.event.commits.*.message, '[skip ci]') == false
steps:
- name: Copy Repo Files
uses: actions/checkout@v2
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'a'
# - name: construct script
# env:
# NODE_ENV: development
# run: |
# printf "#!/bin/bash\n" > ./server_exec.sh
# printf "SERVER_PATH=${{secrets.SERVER_PATH}}\n" >> ./server_exec.sh
# cat ./scripts/server-refresh.sh >> ./server_exec.sh
# chmod +x ./server_exec.sh
# - name: Exec Script
# env:
# SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
# SSH_HOST: ${{ secrets.SSH_HOST }}
# PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# run: |
# ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts
# cat ./server_exec.sh
# ssh ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} < ./server_exec.sh
# - name: Telegram send success message
# if: ${{ success() }}
# env:
# TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
# COMMITS: ${{ toJSON(github.event.commits) }}
# RUN_NUMBER: ${{ github.run_number }}
# BUILD_DESCRIPTION: ✅ 呵呵,相册测试服前端已经部署。
# run: |
# node ./scripts/tg-message.js
# - name: Telegram send failure message
# if: ${{ failure() }}
# env:
# TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
# COMMITS: ${{ toJSON(github.event.commits) }}
# RUN_NUMBER: ${{ github.run_number }}
# BUILD_DESCRIPTION: |
# ❌ 呵呵,相册测试服前端部署失败。早该管管了。
# 版本: ${{ steps.package-version.outputs.current-version }}
# run: |
# node ./scripts/tg-message.js