-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcd-{{app_name}}.yml.jinja
More file actions
55 lines (53 loc) · 1.52 KB
/
cd-{{app_name}}.yml.jinja
File metadata and controls
55 lines (53 loc) · 1.52 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
name: Deploy {{ app_name }}
# 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 ${{'{{'}}inputs.version || 'main' {{'}}'}} to {{ app_name }} ${{'{{'}} inputs.environment || 'dev' {{'}}'}}
on:
{% if app_has_dev_env_setup %}
push:
branches:
- "main"
paths:
- "{{ app_name }}/**"
- "bin/**"
- "infra/**"
{% else %}
# !! Once you've set up the dev environment and are ready to enable continuous
# deployment, run:
#
# nava-platform infra update --answers-only --data app_has_dev_env_setup=true .
#
# to enable these lines. They are here as comments for context.
#
# push:
# branches:
# - "main"
# paths:
# - "{{ app_name }}/**"
# - "bin/**"
# - "infra/**"
{% endif %}
workflow_dispatch:
inputs:
environment:
description: Environment to deploy to
required: true
default: "dev"
type: choice
options:
- dev
- staging
- prod
version:
required: true
default: "main"
description: Tag or branch or SHA to deploy
jobs:
deploy:
name: " " # GitHub UI is noisy when calling reusable workflows, so use whitespace for name to reduce noise
uses: ./.github/workflows/deploy.yml
with:
app_name: "{{ app_name }}"
environment: ${{'{{'}} inputs.environment || 'dev' {{'}}'}}
version: ${{'{{'}} inputs.version || 'main' {{'}}'}}
secrets: inherit