-
-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (82 loc) · 2.73 KB
/
github-actions-uploader.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
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
90
91
92
93
name: uploader
on:
push:
paths:
- "apps/uploader/**"
branches:
- "**"
pull_request:
paths:
- "apps/uploader/**"
branches:
- "**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Pnpm
uses: pnpm/action-setup@v4
with:
version: 9.14.2
- name: Install dependencies
run: pnpm install
- name: Pre compilation
run: pnpm run build --filter uploader
# テスト成功時はこちらのステップが実行される
- name: Slack Notification on Success at Testing Stage
if: success()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }}
SLACK_CHANNEL: github-actions
SLACK_TITLE: Test Success
SLACK_COLOR: good
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.'
# テスト失敗時はこちらのステップが実行される
- name: Slack Notification on Failure at Testing Stage
uses: rtCamp/action-slack-notify@v2
if: failure()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }}
SLACK_CHANNEL: github-actions
SLACK_TITLE: Test Failure
SLACK_COLOR: danger
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.'
deployment:
runs-on: ubuntu-latest
continue-on-error: true
needs: test
if: github.ref == 'refs/heads/master'
steps:
- name: Deploy to server
uses: appleboy/ssh-action@v0.1.4
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: sh ./@beg-monorepo-uploader-deploy.sh
# テスト成功時はこちらのステップが実行される
- name: Slack Notification on Success at Deployment Stage
if: success()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }}
SLACK_CHANNEL: github-actions
SLACK_TITLE: Deploy Success
SLACK_COLOR: good
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.'
# テスト失敗時はこちらのステップが実行される
- name: Slack Notification on Failure at Deployment Stage
uses: rtCamp/action-slack-notify@v2
if: failure()
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOKS }}
SLACK_CHANNEL: github-actions
SLACK_TITLE: Deploy Failure
SLACK_COLOR: danger
SLACK_FOOTER: 'Powered by Yancey Inc. and its affiliates.'