Skip to content

Commit

Permalink
chore(SER-3309): Refactor GA deployment jobs to avoid duplicationg en…
Browse files Browse the repository at this point in the history
…v variables
  • Loading branch information
amydoxym committed Dec 3, 2024
1 parent 24b942b commit 195f3b8
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 69 deletions.
79 changes: 10 additions & 69 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,81 +125,22 @@ jobs:
## Deploy to the various clusters
Integration-k8s:
if: github.event.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
needs: [build, sonarcloud]
environment:
name: Integration
steps:
- uses: actions/[email protected]

- uses: one-acre-fund/oaf-actions/helm_setup@main
with:
ARTIFACT_NAME: "fineract-frontend-v2"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
RUN_ID: "${{ github.run_id }}"
CI_REPOSITORY: "${{ github.repository }}"
K8S_URL: "${{ secrets.K8S_TEST_URL }}"
K8S_SECRET: "${{ secrets.K8S_TEST_DEFAULT }}"
uses: ./.github/workflows/deploy.yml
with:
environment: "Integration"
k8s_url: "${{ secrets.K8S_TEST_URL }}"
k8s_secret: "${{ secrets.K8S_TEST_DEFAULT }}"

- uses: "./.github/actions/helm_fineract_frontend"
with:
NAMESPACE: "${{ vars.NAMESPACE }}"
ACR_PULL_PASSWORD: "${{ secrets.ACR_PULL_PASSWORD }}"
ACR_PULL_USERNAME: "${{ vars.ACR_PULL_USERNAME }}"
REPLICAS: "${{ vars.REPLICAS }}"
RELEASE_NAME: "${{ vars.RELEASE_NAME }}"
FINERACT_PROXY_URL: "${{ vars.FINERACT_PROXY_URL }}"
FINERACT_PROXY_HTTPS_PORT: "${{ vars.FINERACT_PROXY_HTTPS_PORT }}"
FINERACT_PROXY_HTTP_PORT: "${{ vars.FINERACT_PROXY_HTTP_PORT }}"
FINERACT_KEYCLOAK_REALM: "${{ vars.FINERACT_KEYCLOAK_REALM }}"
FINERACT_KEYCLOAK_CLIENT_ID: "${{ vars.FINERACT_KEYCLOAK_CLIENT_ID }}"
FINERACT_KEYCLOAK_TOKEN_URL: "${{ vars.FINERACT_KEYCLOAK_TOKEN_URL }}"
FINERACT_KEYCLOAK_AUTH_SERVER_URL: "${{ vars.FINERACT_KEYCLOAK_AUTH_SERVER_URL }}"
FINERACT_KEYCLOAK_API_URL: "${{ vars.FINERACT_KEYCLOAK_API_URL }}"
FINERACT_HOST_HOME_URL: "${{ vars.FINERACT_HOST_HOME_URL }}"
FINERACT_BASE_URL: "${{ vars.FINERACT_BASE_URL }}"
FINERACT_AUTH_URL: "${{ vars.FINERACT_AUTH_URL }}"
FINERACT_API_URL: "${{ vars.FINERACT_API_URL }}"
MATOMO_SITE_ID: "${{ vars.MATOMO_SITE_ID }}"
MATOMO_SITE_URL: "${{ vars.MATOMO_SITE_URL }}"
QA-k8s:
runs-on: ubuntu-latest
needs: Integration-k8s
if: github.event.ref == 'refs/heads/develop'
environment:
name: QA
steps:
- uses: actions/[email protected]
uses: ./.github/workflows/deploy.yml
with:
environment: "QA"
k8s_url: "${{ secrets.K8S_QA_URL }}"
k8s_secret: "${{ secrets.K8S_QA_DEFAULT }}"

- uses: one-acre-fund/oaf-actions/helm_setup@main
with:
ARTIFACT_NAME: "fineract-frontend-v2"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
RUN_ID: "${{ github.run_id }}"
CI_REPOSITORY: "${{ github.repository }}"
K8S_URL: "${{ secrets.K8S_QA_URL }}"
K8S_SECRET: "${{ secrets.K8S_QA_DEFAULT }}"
- uses: "./.github/actions/helm_fineract_frontend"
with:
NAMESPACE: "${{ vars.NAMESPACE }}"
ACR_PULL_PASSWORD: "${{ secrets.ACR_PULL_PASSWORD }}"
ACR_PULL_USERNAME: "${{ vars.ACR_PULL_USERNAME }}"
REPLICAS: "${{ vars.REPLICAS }}"
RELEASE_NAME: "${{ vars.RELEASE_NAME }}"
FINERACT_PROXY_URL: "${{ vars.FINERACT_PROXY_URL }}"
FINERACT_PROXY_HTTPS_PORT: "${{ vars.FINERACT_PROXY_HTTPS_PORT }}"
FINERACT_PROXY_HTTP_PORT: "${{ vars.FINERACT_PROXY_HTTP_PORT }}"
FINERACT_KEYCLOAK_REALM: "${{ vars.FINERACT_KEYCLOAK_REALM }}"
FINERACT_KEYCLOAK_CLIENT_ID: "${{ vars.FINERACT_KEYCLOAK_CLIENT_ID }}"
FINERACT_KEYCLOAK_TOKEN_URL: "${{ vars.FINERACT_KEYCLOAK_TOKEN_URL }}"
FINERACT_KEYCLOAK_AUTH_SERVER_URL: "${{ vars.FINERACT_KEYCLOAK_AUTH_SERVER_URL }}"
FINERACT_KEYCLOAK_API_URL: "${{ vars.FINERACT_KEYCLOAK_API_URL }}"
FINERACT_HOST_HOME_URL: "${{ vars.FINERACT_HOST_HOME_URL }}"
FINERACT_BASE_URL: "${{ vars.FINERACT_BASE_URL }}"
FINERACT_AUTH_URL: "${{ vars.FINERACT_AUTH_URL }}"
FINERACT_API_URL: "${{ vars.FINERACT_API_URL }}"
MATOMO_SITE_ID: "${{ vars.MATOMO_SITE_ID }}"
MATOMO_SITE_URL: "${{ vars.MATOMO_SITE_URL }}"
UAT-k8s:
runs-on: ubuntu-latest
if: github.event.ref == 'refs/heads/main' || contains(github.event.ref, 'refs/heads/hotfix/') || contains(github.event.ref, 'refs/heads/release/')
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy Workflow

on:
workflow_call:
inputs:
environment:
required: true
type: string
k8s_url:
required: true
type: string
k8s_secret:
required: true
type: string

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v4

- uses: one-acre-fund/oaf-actions/helm_setup@main
with:
ARTIFACT_NAME: "fineract-frontend-v2"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
RUN_ID: "${{ github.run_id }}"
CI_REPOSITORY: "${{ github.repository }}"
K8S_URL: "${{ inputs.k8s_url }}"
K8S_SECRET: "${{ inputs.k8s_secret }}"

- uses: "./.github/actions/helm_fineract_frontend"
with:
NAMESPACE: "${{ vars.NAMESPACE }}"
ACR_PULL_PASSWORD: "${{ secrets.ACR_PULL_PASSWORD }}"
ACR_PULL_USERNAME: "${{ vars.ACR_PULL_USERNAME }}"
REPLICAS: "${{ vars.REPLICAS }}"
RELEASE_NAME: "${{ vars.RELEASE_NAME }}"
FINERACT_PROXY_URL: "${{ vars.FINERACT_PROXY_URL }}"
FINERACT_PROXY_HTTPS_PORT: "${{ vars.FINERACT_PROXY_HTTPS_PORT }}"
FINERACT_PROXY_HTTP_PORT: "${{ vars.FINERACT_PROXY_HTTP_PORT }}"
FINERACT_KEYCLOAK_REALM: "${{ vars.FINERACT_KEYCLOAK_REALM }}"
FINERACT_KEYCLOAK_CLIENT_ID: "${{ vars.FINERACT_KEYCLOAK_CLIENT_ID }}"
FINERACT_KEYCLOAK_TOKEN_URL: "${{ vars.FINERACT_KEYCLOAK_TOKEN_URL }}"
FINERACT_KEYCLOAK_AUTH_SERVER_URL: "${{ vars.FINERACT_KEYCLOAK_AUTH_SERVER_URL }}"
FINERACT_KEYCLOAK_API_URL: "${{ vars.FINERACT_KEYCLOAK_API_URL }}"
FINERACT_HOST_HOME_URL: "${{ vars.FINERACT_HOST_HOME_URL }}"
FINERACT_BASE_URL: "${{ vars.FINERACT_BASE_URL }}"
FINERACT_AUTH_URL: "${{ vars.FINERACT_AUTH_URL }}"
FINERACT_API_URL: "${{ vars.FINERACT_API_URL }}"
MATOMO_SITE_ID: "${{ vars.MATOMO_SITE_ID }}"
MATOMO_SITE_URL: "${{ vars.MATOMO_SITE_URL }}"
SENTRY_DSN: "${{ secrets.SENTRY_DSN }}"

0 comments on commit 195f3b8

Please sign in to comment.