-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (47 loc) · 1.52 KB
/
deploy.yaml
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
---
# This workflow will run unit tests and deploy the application to a
# target environment
name: Deploy
on:
push:
branches:
- main
tags:
- "*"
paths-ignore:
- "**.md" # All markdown files in the repository
release:
types: [released]
jobs:
deploy:
if: github.repository_owner == 'GSA-TTS'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: GSA-TTS/identity-idva-cf-setup@v2
id: cf-setup
with:
cf-username: ${{ secrets.CF_USERNAME }}
cf-password: ${{ secrets.CF_PASSWORD }}
cf-org: ${{ secrets.CF_ORG }}
space-suffix: "-warpgate"
- name: Set flow config name
run: |
target_env_upper=${{ steps.cf-setup.outputs.target-environment-upper }}
echo "FLOW_CLIENT_CONFIG_NAME=FLOW_CLIENT_CONFIG_$target_env_upper" >> $GITHUB_ENV
- name: Write flow config to file
env:
FLOW_CLIENT_CONFIG: ${{ secrets[env.FLOW_CLIENT_CONFIG_NAME] }}
run: |
# Ensure the secret is valid JSON
echo "$FLOW_CLIENT_CONFIG" | jq empty
{
echo "---"
echo "FLOW_CLIENT_CONFIG: |"
# sed formats yaml value with proper indentation
echo "$FLOW_CLIENT_CONFIG" | sed 's/^/ /'
} > vars-env.yaml
- name: Deploy application
run: cf push --vars-file vars.yaml --vars-file vars-env.yaml
--var ENVIRONMENT=${{ steps.cf-setup.outputs.target-environment }}
--strategy rolling