-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (63 loc) · 1.95 KB
/
frontend-ci.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
name: Build test with Webpack
on:
pull_request:
branches:
- develop
paths:
- "frontend/**"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "ci-group"
cancel-in-progress: false # 기존 작업 계속 수행
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout to current repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: ./frontend/yarn.lock
- name: Create .env file
run: |
echo "API_BASE_URL=${{ secrets.API_BASE_URL }}" > ./frontend/.env
echo "SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}" >> ./frontend/.env
echo "AMPLITUDE_KEY=${{ secrets.AMPLITUDE_KEY }}" >> ./frontend/.env
- name: Set environment file permissions
run: chmod 644 ./frontend/.env
# 프리플라이트 체크
- name: Preflight Check for Environment Variables
run: |
if [ -z "${{ secrets.API_BASE_URL }}" ]; then
echo "Error: API_BASE_URL is not set"
exit 1
fi
if [ -z "${{ secrets.SENTRY_AUTH_TOKEN }}" ]; then
echo "Error: SENTRY_AUTH_TOKEN is not set"
exit 1
fi
if [ -z "${{ secrets.AMPLITUDE_KEY }}" ]; then
echo "Error: AMPLITUDE_KEY is not set"
exit 1
fi
shell: bash
- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: frontend
- name: Run tests
run: yarn test
working-directory: frontend
- name: Build
run: yarn build
env:
API_BASE_URL: ${{ secrets.API_BASE_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
AMPLITUDE_KEY: ${{ secrets.AMPLITUDE_KEY }}
working-directory: frontend