Skip to content

Commit

Permalink
Merge pull request #160 from dhis2-sre/feature/DEVOPS-262
Browse files Browse the repository at this point in the history
refactor: run instance-manager workflow on PR for feature branches
  • Loading branch information
radnov authored Jul 17, 2023
2 parents fe38f57 + c9dffbe commit 31c0c2c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
name: Tests, build and deploy
name: Build, test and deploy

on:
push:
branches:
- master
- feature/**
tags:
- v*.*.*

pull_request:
types: [opened, reopened, synchronize, labeled]

workflow_dispatch:

# Cancel previous runs of the same workflow and PR number or branch/tag
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
call-workflow:
uses: dhis2-sre/gha-workflows/.github/workflows/instance-manager.yaml@master
uses: dhis2-sre/gha-workflows/.github/workflows/im-build-test-deploy.yaml@master
with:
PROCESS_NAME: nginx
POD_NAME: im-web-client
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/delete-env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Delete deployed environment

on:
pull_request:
types: [closed]

# Cancel previous runs of the same workflow and PR number or branch/tag
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
call-workflow:
uses: dhis2-sre/gha-workflows/.github/workflows/im-delete-env.yaml@master
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
KUBECONFIG: ${{ secrets.KUBECONFIG }}
1 change: 1 addition & 0 deletions helm/data/secrets/feature
1 change: 1 addition & 0 deletions helm/data/values/feature
9 changes: 7 additions & 2 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: skaffold/v2beta25
apiVersion: skaffold/v4beta6
kind: Config
build:
artifacts:
Expand All @@ -13,7 +13,7 @@ deploy:
helm:
releases:
- name: im-web-client-{{ .ENVIRONMENT }}
namespace: instance-manager-{{ .ENVIRONMENT }}
namespace: instance-manager-{{ .CLASSIFICATION }}
createNamespace: true
chartPath: helm/chart
setValueTemplates:
Expand All @@ -23,3 +23,8 @@ deploy:
certIssuer: cert-issuer-prod
valuesFiles:
- helm/data/values/{{ .CLASSIFICATION }}/values.yaml

# TODO should we use empty profiles to conform to the instance-manager reusable workflow or have a conditional in the workflow Deploy step (`if repo is im-manager ...`)?
profiles:
- name: dev
- name: prod

0 comments on commit 31c0c2c

Please sign in to comment.