-
Notifications
You must be signed in to change notification settings - Fork 0
195 lines (167 loc) · 5.31 KB
/
deploy.yaml
File metadata and controls
195 lines (167 loc) · 5.31 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Main Workflow
on:
push:
branches:
- dev
workflow_dispatch:
jobs:
build:
name: main
timeout-minutes: 15
runs-on: ubuntu-24.04
steps:
- name: Check out code
uses: actions/checkout@v4.1.1
with:
fetch-depth: 2
- name: Cache turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
# TODO setup node does not yet work correctly w/ yarn v4
# Workaround https://github.com/actions/setup-node/issues/531#issuecomment-1416814256
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.2
with:
node-version-file: ".nvmrc"
- name: Install Yarn
run: corepack enable &&
corepack prepare yarn@stable --activate
- name: Extract cached dependencies
uses: actions/setup-node@v4
with:
cache: yarn
- name: Update dependencies
run: yarn install --immutable
- name: Linting
run: yarn run lint
- name: Unit and integration tests
run: yarn run test
continue-on-error: true
# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: Fix coverage paths
# run: |
# sed -i 's|/home/runner/work/flywheel-backend/flywheel-backend|.|g' coverage.xml
# - name: Publish test results
# uses: dorny/test-reporter@v1
# with:
# name: Test Results
# path: coverage.xml
# reporter: junit
# fail-on-error: false
# name: Deploy Workflow
# on:
# push:
# branches:
# - dev
# - stage
# - prod
# jobs:
# Deploy:
# name: main
# timeout-minutes: 15
# runs-on: ubuntu-22.04
# steps:
# - name: Check out code
# uses: actions/checkout@v4.1.1
# with:
# fetch-depth: 2
# - name: Check out code
# uses: actions/checkout@v4.1.1
# with:
# repository: wuerthcs/flywheel-frontend
# path: flywheel-frontend
# - name: Mapping for slack notification
# uses: lineashub/variable-mapper@master
# with:
# key: "${{ github.ref_name }}"
# map: |
# {
# "dev": {
# "SLACK_WEBHOOK": "${{ secrets.SLACK_WEBHOOK_DEV }}",
# "SLACK_CHANNEL": "deploy-dev"
# },
# "stage": {
# "SLACK_WEBHOOK": "${{ secrets.SLACK_WEBHOOK_STAGE }}",
# "SLACK_CHANNEL": "deploy-stage"
# },
# "prod": {
# "SLACK_WEBHOOK": "${{ secrets.SLACK_WEBHOOK_PROD }}",
# "SLACK_CHANNEL": "deploy-prod"
# }
# }
# - name: Cypress tests for stage
# if: github.ref == 'refs/heads/stage'
# uses: peter-evans/repository-dispatch@v3
# with:
# token: ${{ secrets.WCS_GITHUB_TOKEN }}
# repository: wuerthcs/flywheel-e2e-tests
# event-type: e2e-test-event
# - name: Setup Node.js environment
# uses: actions/setup-node@v3
# with:
# node-version-file: '.nvmrc'
# - name: Install Yarn
# run: corepack enable &&
# corepack prepare yarn@stable --activate
# - name: Update dependencies
# run: yarn install --immutable
# - name: Compile development branch
# run: yarn build
# env:
# CI_ENV: ${{ github.ref_name }}
# - name: Install copilot
# uses: ksivamuthu/aws-copilot-github-action@v0.0.7
# with:
# command: install
# - name: Login to AWS account
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: eu-central-1
# # TODO Should be done directly w/ copilot action above, but it does not (yet) support `--all` flag
# - name: Deploy to AWS
# run: copilot deploy --all --env ${{ github.ref_name }}
# - name: Mapping for slack notification
# uses: kanga333/variable-mapper@v0.3.0
# with:
# key: "${{ github.ref_name }}"
# map: |
# {
# "dev": {
# "SLACK_WEBHOOK": "${{ secrets.SLACK_WEBHOOK_DEV }}",
# },
# "stage": {
# "SLACK_WEBHOOK": "${{ secrets.SLACK_WEBHOOK_STAGE }}",
# },
# "prod": {
# "SLACK_WEBHOOK": "${{ secrets.SLACK_WEBHOOK_PROD }}"
# }
# }
# - name: Slack success
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_TITLE: "${{ github.job }} on ${{ github.repository }} has been Successful!"
# SLACK_COLOR: "#228B22"
# SLACK_MESSAGE: "${{ github.event.pull_request.head.ref }} has triggered this run"
# SLACK_FOOTER: " "
# MSG_MINIMAL: "Ref,Actions URL,Commit"
# if: success() && github.ref == 'refs/heads/dev'
# - name: Slack failure
# uses: rtCamp/action-slack-notify@master
# env:
# SLACK_TITLE: "${{ github.job }} on ${{ github.repository }} has Failed!"
# SLACK_COLOR: "##E01E5A"
# SLACK_MESSAGE: "${{ github.event.pull_request.head.ref }} has triggered this run"
# SLACK_FOOTER: " "
# MSG_MINIMAL: "Ref,Actions URL,Commit"
# if: failure() && github.ref == 'refs/heads/dev'
# # if: failure() && github.ref == 'refs/heads/dev'