Skip to content

Commit

Permalink
Merge pull request #582 from sgibson91/matrix-job
Browse files Browse the repository at this point in the history
Use a matrix job to deploy our hubs
  • Loading branch information
sgibson91 authored Aug 5, 2021
2 parents 845c961 + 9433e16 commit 0569838
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 60 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/deploy-2i2c.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/deploy-cloudbank.yaml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/deploy-hubs.yaml
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 }}

0 comments on commit 0569838

Please sign in to comment.