-
Notifications
You must be signed in to change notification settings - Fork 13
38 lines (35 loc) · 1015 Bytes
/
cd-api.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
name: Deploy API
# Need to set a default value for when the workflow is triggered from a git push
# which bypasses the default configuration for inputs
run-name: Deploy ${{ github.ref_name }} to API ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}
on:
push:
branches:
- "main"
- "tf-debug" # <= for testing purposes
paths:
- "api/**"
- ".github/workflows/cd-api.yml" # <= for testing purposes
release:
types: [published]
workflow_dispatch:
inputs:
environment:
description: "target environment"
required: true
default: "dev"
type: choice
options:
- dev
- prod
jobs:
api-checks:
name: Run API Checks
uses: ./.github/workflows/ci-api.yml
deploy:
name: Deploy
needs: api-checks
uses: ./.github/workflows/deploy.yml
with:
app_name: "api"
environment: ${{ inputs.environment || (github.event_name == 'release' && 'prod') || 'dev' }}