forked from 2i2c-org/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (111 loc) · 3.69 KB
/
deploy-hubs.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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Deploy and test hubs
on:
push:
branches:
- master
paths:
- deployer/**
- helm-charts/**
- requirements.txt
- dev-requirements.txt
- config/secrets.yaml
- config/clusters/**
- .github/workflows/deploy-hubs.yaml
- .github/actions/deploy/**
# When multiple PRs triggering this workflow are merged, queue them instead
# of running them in parallel
# https://github.blog/changelog/2021-04-19-github-actions-limit-workflow-run-or-job-concurrency/
concurrency: deploy
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
# Don't stop other deployments if one fails
fail-fast: false
matrix:
include:
# To enable auto-deployments for other clusters,
# add its name and provider to the list
- cluster_name: 2i2c
provider: gcp
- cluster_name: cloudbank
provider: gcp
- cluster_name: carbonplan
provider: aws
- cluster_name: farallon
provider: aws
- cluster_name: openscapes
provider: aws
- cluster_name: uwhackweeks
provider: aws
- cluster_name: meom-ige
provider: gcp
- cluster_name: pangeo-hubs
provider: gcp
- cluster_name: utoronto
provider: kubeconfig
- cluster_name: azure.carbonplan
provider: kubeconfig
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Check if any of our base files have changed
uses: dorny/paths-filter@v2
id: base_files
with:
filters: |
files:
- "deployer/**"
- "helm-charts/**"
- "requirements.txt"
- "config/secrets.yaml"
- ".github/workflows/deploy-hubs.yaml"
- ".github/actions/deploy/*"
- name: Check which cluster directory has changes (if any)
uses: dorny/paths-filter@v2
id: config_files
with:
filters: |
hub_config:
- "config/clusters/${{ matrix.cluster_name }}/**"
- name: Setup gcloud
if: |
(steps.base_files.outputs.files == 'true') ||
(steps.config_files.outputs.hub_config == 'true')
uses: google-github-actions/setup-gcloud@master
with:
version: "290.0.1"
# This is used for KMS only
project_id: two-eye-two-see
service_account_key: ${{ secrets.GCP_KMS_DECRYPTOR_KEY }}
export_default_credentials: true
- name: Setup helm
if: |
(steps.base_files.outputs.files == 'true') ||
(steps.config_files.outputs.hub_config == 'true')
uses: azure/[email protected]
- name: Setup sops
if: |
(steps.base_files.outputs.files == 'true') ||
(steps.config_files.outputs.hub_config == 'true')
uses: mdgreenwald/mozilla-sops-action@v1
- name: Setup kops
if: |
((steps.base_files.outputs.files == 'true') ||
(steps.config_files.outputs.hub_config == 'true')) &&
(matrix.provider == 'aws')
run: |
curl -Lo /tmp/kops https://github.com/kubernetes/kops/releases/download/$KOPS_VERSION/kops-linux-amd64
chmod +x /tmp/kops
sudo mv /tmp/kops /usr/local/bin/kops
env:
KOPS_VERSION: "v1.21.1"
- name: Deploy ${{ matrix.cluster_name }}
if: |
(steps.base_files.outputs.files == 'true') ||
(steps.config_files.outputs.hub_config == 'true')
uses: ./.github/actions/deploy
with:
cluster: ${{ matrix.cluster_name }}
env:
TERM: xterm