-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub.tmpl
104 lines (86 loc) · 2.74 KB
/
github.tmpl
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: "[{{ .Env }}] Infra & Apps Deploy"
concurrency:
group: {{ print "${{ github.workflow }}" }}
cancel-in-progress: false
defaults:
run:
shell: bash
env:
AWS_REGION: {{ .AwsRegion }}
ENV: {{ .Env }}
SSH_PUBLIC_KEY: {{ .PublicKey }}
NAMESPACE: {{ .Namespace }}
AWS_PROFILE: gringaming-dev01
IZE_LOG_LEVEL: debug
IZE_PREFER_RUNTIME: docker
on:
workflow_dispatch
jobs:
infra: # Create infrastructure for services on push to Develop branch
runs-on: ubuntu-latest
env:
TAG: {{ print `"${{ github.sha }}"` }}
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: {{ print "${{ secrets.AWS_ACCESS_KEY_ID_DEV }}" }}
aws-secret-access-key: {{ print "${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}" }}
aws-region: {{ print "${{ env.AWS_REGION }}" }}
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: true
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: {{ print "${{ env.SSH_PUBLIC_KEY }}" }}
name: id_rsa.pub
known_hosts: unnecessary
if_key_exists: replace
- name: Create AWS Profile
run: ize gen aws-profile
shell: bash
- name: ize setup
uses: hazelops/action-setup-ize@0.0.1
with:
version: 1.0.0
- name: Deploy Infra
run: ize up infra
shell: bash
{{ range $key, $value := .Apps }}
{{ $key }}:
runs-on: ubuntu-latest
name: {{ $key }}
env:
TAG: {{ print `"${{ github.sha }}"` }}
needs: infra
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: {{ print "${{ secrets.AWS_ACCESS_KEY_ID_DEV }}" }}
aws-secret-access-key: {{ print "${{ secrets.AWS_SECRET_ACCESS_KEY_DEV }}" }}
aws-region: {{ print "${{ env.AWS_REGION }}" }}
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: true
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: {{ print "${{ env.SSH_PUBLIC_KEY }}" }}
name: id_rsa.pub
known_hosts: unnecessary
if_key_exists: replace
- name: Create AWS Profile
run: ize gen aws-profile
shell: bash
- name: Ize Setup
uses: hazelops/action-setup-ize@0.0.1
with:
version: 1.0.0
- name: Deploy App
run: ize up {{ print "${{ github.job }}" }}
shell: bash
{{ end }}