-
Notifications
You must be signed in to change notification settings - Fork 13
52 lines (47 loc) · 1.38 KB
/
cd-frontend.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
name: Deploy Frontend
run-name: Deploy ${{ github.ref_name }} to Frontend ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'nonprod' }}
on:
push:
branches:
- "main"
paths:
- "frontend/**"
release:
types: [published]
workflow_dispatch:
inputs:
environment:
description: "target environment"
required: true
default: "dev"
type: choice
options:
- dev
- staging
- prod
jobs:
frontend-checks:
name: Run Frontend Checks
uses: ./.github/workflows/ci-frontend.yml
vulnerability-scans:
name: Vulnerability Scans
uses: ./.github/workflows/vulnerability-scans.yml
with:
app_name: frontend
deploy:
name: Deploy
needs: [frontend-checks, vulnerability-scans]
uses: ./.github/workflows/deploy.yml
strategy:
max-parallel: 1
fail-fast: false
matrix:
envs: ${{ fromJSON(inputs.environment != null && format('["{0}"]', inputs.environment) || github.event_name == 'release' && '["prod"]' || github.ref_name == 'main' && '["dev", "staging"]' || '["dev"]') }}
with:
app_name: "frontend"
environment: ${{ matrix.envs }}
send-slack-notification:
if: failure()
needs: [frontend-checks, vulnerability-scans, deploy]
uses: ./.github/workflows/send-slack-notification.yml
secrets: inherit