Skip to content

Commit

Permalink
Merge branch 'dev' into illiar/feat/collection-flow-customization
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterkmr committed Sep 3, 2024
2 parents 017b72b + 07340ed commit decaf2c
Show file tree
Hide file tree
Showing 799 changed files with 29,340 additions and 4,099 deletions.
170 changes: 170 additions & 0 deletions .github/workflows/db-ops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
name: Database Operations

on:
workflow_dispatch:
inputs:
environment:
type: choice
description: 'Choose Environment'
required: true
default: 'dev'
options:
- 'dev'
- 'sb'
- 'prod'
tag:
type: string
description: 'Image Tag'
required: true
default: ''

workflow_call:
inputs:
environment:
type: string
description: 'Environment'
required: true
default: 'dev'
tag:
type: string
description: 'Image Tag'
required: true
default: ''
# workflow_dispatch:
# inputs:
# environment:
# description: 'Select environment'
# type: choice
# options:
# - dev
# - sb
# - prod
# required: true
# data-sync:
# description: 'Run data sync'
# type: boolean
# default: false
# data-migration:
# description: 'Run data migration'
# type: boolean
# default: false
# prisma-migration:
# description: 'Run Prisma migration'
# type: boolean
# default: false

jobs:
# database-ops:
# runs-on: ubuntu-latest

# environment: ${{ github.event.inputs.environment }}

# permissions:
# id-token: write
# contents: read

# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Install pnpm
# uses: pnpm/action-setup@v2
# with:
# version: 8
# run_install: false

# - name: Install Node.js
# uses: actions/setup-node@v3
# with:
# node-version-file: ".nvmrc"
# registry-url: https://registry.npmjs.org
# cache: 'pnpm'

# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# aws-region: ${{ secrets.AWS_REGION }}
# role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
# role-session-name: MySessionName
# role-duration-seconds: 300

# - name: Get secrets
# uses: aws-actions/aws-secretsmanager-get-secrets@v2
# with:
# secret-ids: ${{ secrets.AWS_SECRET_MANAGER_WORKFLOW_NAME }}

# - name: Setup Twingate
# uses: twingate/github-action@v1
# with:
# service-key: ${{ secrets.TWINGATE_SERVICE_KEY_SECRET_NAME }}

# - name: Install dependencies
# run: npm install --legacy-peer-deps

# - name: Run Data Sync
# if: ${{ github.event.inputs.data-sync == 'true' }}
# run: dumb-init npm run db:data-sync
# env:
# NODE_ENV: ${{ github.event.inputs.environment }}

# - name: Run Data Migration
# if: ${{ github.event.inputs.data-migration == 'true' }}
# run: dumb-init npm run db:data-migration:migrate
# env:
# NODE_ENV: ${{ github.event.inputs.environment }}

# - name: Run Prisma Migration
# if: ${{ github.event.inputs.prisma-migration == 'true' }}
# run: dumb-init npm run db:migrate-up
# env:
# NODE_ENV: ${{ github.event.inputs.environment }}

update-helm-chart:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Checkout cloud-infra-config repository
uses: actions/checkout@v4
with:
repository: ballerine-io/cloud-infra-config
token: ${{ secrets.GIT_TOKEN }}
ref: main
fetch-depth: 1
sparse-checkout: |
kubernetes/helm/wf-service
sparse-checkout-cone-mode: true
- name: Check if values yaml file exists
id: update_helm_check
shell: bash
run: |
if [ -f "kubernetes/helm/wf-service/${{ github.event.inputs.environment }}-custom-values.yaml" ]; then
echo "file_name=${{ github.event.inputs.environment }}-custom-values.yaml" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event.inputs.environment }}" == "dev" ]; then
echo "file_name=dev-custom-values.yaml" >> "$GITHUB_OUTPUT"
else
echo "skip_helm=true" >> "$GITHUB_OUTPUT"
fi
- name: Update workflow-service image version in the HelmChart
if: ${{ steps.update_helm_check.outputs.skip_helm != 'true' }}
uses: fjogeleit/yaml-update-action@main
with:
repository: ballerine-io/cloud-infra-config
branch: main
commitChange: true
message: 'Update wf-service image Version to ${{ github.event.inputs.tag }} - (Commit hash: ${{ github.sha }}, commit message: ${{ github.event.head_commit.message }})'
token: ${{ secrets.GIT_TOKEN }}
changes: |
{
"kubernetes/helm/wf-service/${{steps.update_helm_check.outputs.file_name}}": {
"prismaMigrate.image.tag": "${{ github.event.inputs.tag }}",
"dbMigrate.image.tag": "${{ github.event.inputs.tag }}",
"dbSync.image.tag": "${{ github.event.inputs.tag }}",
}
}
88 changes: 88 additions & 0 deletions .github/workflows/deploy-wf-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Publish workflows-service image

on:
workflow_dispatch:
inputs:
environment:
type: choice
description: 'Choose Environment'
required: true
default: 'dev'
options:
- 'dev'
- 'sb'
- 'prod'
tag:
type: string
description: 'Image Tag'
required: true
default: ''

workflow_call:
inputs:
environment:
type: string
description: 'Environment'
required: true
default: 'dev'
tag:
type: string
description: 'Image Tag'
required: true
default: ''

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/workflows-service

jobs:
update-helm-chart:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Checkout cloud-infra-config repository
uses: actions/checkout@v4
with:
repository: ballerine-io/cloud-infra-config
token: ${{ secrets.GIT_TOKEN }}
ref: main
fetch-depth: 1
sparse-checkout: |
kubernetes/helm/wf-service
sparse-checkout-cone-mode: true
- name: Check if values yaml file exists
id: update_helm_check
shell: bash
run: |
if [ -f "kubernetes/helm/wf-service/${{ github.event.inputs.environment }}-custom-values.yaml" ]; then
echo "file_name=${{ github.event.inputs.environment }}-custom-values.yaml" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event.inputs.environment }}" == "dev" ]; then
echo "file_name=dev-custom-values.yaml" >> "$GITHUB_OUTPUT"
else
echo "skip_helm=true" >> "$GITHUB_OUTPUT"
fi
- name: Update workflow-service image version in the HelmChart
if: ${{ steps.update_helm_check.outputs.skip_helm != 'true' }}
uses: fjogeleit/yaml-update-action@main
with:
repository: ballerine-io/cloud-infra-config
branch: main
commitChange: true
message: 'Update wf-service image Version to ${{ github.event.inputs.tag }} - (Commit hash: ${{ github.sha }}, commit message: ${{ github.event.head_commit.message }})'
token: ${{ secrets.GIT_TOKEN }}
changes: |
{
"kubernetes/helm/wf-service/${{steps.update_helm_check.outputs.file_name}}": {
"image.tag": "${{ github.event.inputs.tag }}",
"prismaMigrate.image.tag": "${{ github.event.inputs.tag }}",
"dbMigrate.image.tag": "${{ github.event.inputs.tag }}",
"dbSync.image.tag": "${{ github.event.inputs.tag }}",
}
}
15 changes: 8 additions & 7 deletions .github/workflows/publish-workflows-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/workflows-service


jobs:

determine_branch:
Expand Down Expand Up @@ -90,16 +91,16 @@ jobs:
tag: ${{ steps.version.outputs.tag }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: 'arm64,arm'

- name: Cache Docker layers
id: cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
Expand Down Expand Up @@ -156,7 +157,7 @@ jobs:
platforms: linux/amd64
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
tags: ${{ steps.docker_meta.outputs.tags }}
build-args: |
"RELEASE=${{ steps.bump-version.outputs.tag }}"
Expand Down Expand Up @@ -220,7 +221,7 @@ jobs:
changes: |
{
"kubernetes/helm/wf-service/${{steps.update_helm_check.outputs.file_name}}": {
"image.tag": "${{ needs.build-and-push-ee-image.outputs.docker_tag }}"
"image.tag": "${{ needs.build-and-push-ee-image.outputs.docker_tag }}",
}
}
Expand Down Expand Up @@ -359,10 +360,10 @@ jobs:
cd ../../../..
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
with:
platforms: 'arm64,arm'

Expand Down
Loading

0 comments on commit decaf2c

Please sign in to comment.