-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #582 from sgibson91/matrix-job
Use a matrix job to deploy our hubs
- Loading branch information
Showing
3 changed files
with
85 additions
and
60 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Deploy and test hubs | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- deployer/** | ||
- hub-templates/** | ||
- requirements.txt | ||
- dev-requirements.txt | ||
- config/secrets.yaml | ||
- config/hubs/** | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
# Don't stop other deployments if one fails | ||
fail-fast: false | ||
matrix: | ||
cluster_name: | ||
# To enable auto-deployments for other clusters, | ||
# add its name to the list | ||
- 2i2c | ||
- cloudbank | ||
- carbonplan | ||
- meom-ige | ||
- pangeo-181919 | ||
|
||
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/**" | ||
- "hub-templates/**" | ||
- "requirements.txt" | ||
- "dev-requirements.txt" | ||
- "config/secrets.yaml" | ||
- name: Check which cluster.yaml file has changed (if any) | ||
uses: dorny/paths-filter@v2 | ||
id: config_files | ||
with: | ||
filters: | | ||
hub_config: | ||
- "config/hubs/${{ matrix.cluster_name }}.cluster.yaml" | ||
- 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/setup-helm@v1 | ||
|
||
- name: Setup sops | ||
if: | | ||
(steps.base_files.outputs.files == 'true') || | ||
(steps.config_files.outputs.hub_config == 'true') | ||
uses: mdgreenwald/mozilla-sops-action@v1 | ||
|
||
- 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 }} |