-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (83 loc) · 2.38 KB
/
CD-production.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
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
name: CD | Production
concurrency:
group: master
cancel-in-progress: false
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy-frontman:
name: Deploy frontman on production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Save known_hosts file
env:
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }}
shell: bash
run: |
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
- name: Save id_rsa file
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
shell: bash
run: |
echo "$SSH_PRIVATE_KEY" > id_rsa && chmod 600 id_rsa
- name: Save vault password to vault.txt
env:
VAULT_PASSWORD: ${{ secrets.VAULT_PASSWORD }}
shell: bash
run: |
echo "$VAULT_PASSWORD" > vault.txt && chmod 600 vault.txt
- name: Run playbook
shell: bash
run: make deploy_frontman
deploy-proxies:
name: Deploy proxies on production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Save known_hosts file
env:
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }}
shell: bash
run: |
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
- name: Save id_rsa file
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
shell: bash
run: |
echo "$SSH_PRIVATE_KEY" > id_rsa && chmod 600 id_rsa
- name: Save vault password to vault.txt
env:
VAULT_PASSWORD: ${{ secrets.VAULT_PASSWORD }}
shell: bash
run: |
echo "$VAULT_PASSWORD" > vault.txt && chmod 600 vault.txt
- name: Run playbook
shell: bash
run: make deploy_proxies
generate-users-csv:
name: Generate users.csv
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Save vault password to vault.txt
env:
VAULT_PASSWORD: ${{ secrets.VAULT_PASSWORD }}
shell: bash
run: |
echo "$VAULT_PASSWORD" > vault.txt && chmod 600 vault.txt
- name: Run playbook
shell: bash
run: make users_csv_generate users_csv_encrypt
- name: Upload users.csv
uses: actions/upload-artifact@v3
with:
name: users.csv
path: users.csv