-
Notifications
You must be signed in to change notification settings - Fork 4
107 lines (101 loc) · 3.15 KB
/
pr.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: AWS CDK CI - PR
on:
pull_request:
branches:
- main
- develop
paths:
- "**.ts"
- "src/**"
- ".github/workflows/pr.yml"
- "**.json"
- "**.yaml"
env:
GITHUB_OAUTH_TOKEN: ${{ secrets.ACCESS_TOKEN_GITHUB }}
WEBSITE_DEV_PASS: ${{ secrets.WEBSITE_DEV_PASS }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
COGNITO_AFFILIATE_REGION: ${{ secrets.COGNITO_AFFILIATE_REGION }}
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GOOGLE_API_SERVICE_ACCOUNT_INFO: ${{ secrets.GOOGLE_API_SERVICE_ACCOUNT_INFO }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_WORKSPACE_ID: ${{ secrets.SLACK_WORKSPACE_ID }}
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEPLOY_KEY: ${{ secrets.FEEDS_DEPLOY_PRIVATE_KEY }}
MASTER_VITE_GA_ID: ${{secrets.VITE_GA_ID}}
DEV_VITE_GA_ID: ${{secrets.DEV_VITE_GA_ID}}
STAGE: dev
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Lint
run: pnpm run lint
synth:
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Synth
run: cdk synth
test:
runs-on: ubuntu-latest
needs: [synth]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Test
run: pnpm test
validate:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Diff
id: diff
run: |
cdk diff --no-color 2>&1 | tee /tmp/diff.log
LOG="$(cat /tmp/diff.log)"
LOG="${LOG//'%'/'%25'}"
LOG="${LOG//$'\n'/'%0A'}"
LOG="${LOG//$'\r'/'%0D'}"
echo "::set-output name=log::$LOG"
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "### Diff Output:"
- name: Comment
if: steps.fc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
### Diff Output:
```
${{ steps.diff.outputs.log }}
```
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update Comment
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body: |
### Diff Output:
```
${{ steps.diff.outputs.log }}
```
token: ${{ secrets.GITHUB_TOKEN }}