mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-04 16:30:33 -06:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
101 lines
3.3 KiB
YAML
101 lines
3.3 KiB
YAML
name: Formbricks Cloud Deployment
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
VERSION:
|
|
description: 'The version of the Docker image to release'
|
|
required: true
|
|
type: string
|
|
REPOSITORY:
|
|
description: 'The repository to use for the Docker image'
|
|
required: false
|
|
type: string
|
|
default: 'ghcr.io/formbricks/formbricks'
|
|
ENVIRONMENT:
|
|
description: 'The environment to deploy to'
|
|
required: true
|
|
type: choice
|
|
options:
|
|
- stage
|
|
- prod
|
|
workflow_call:
|
|
inputs:
|
|
VERSION:
|
|
description: 'The version of the Docker image to release'
|
|
required: true
|
|
type: string
|
|
REPOSITORY:
|
|
description: 'The repository to use for the Docker image'
|
|
required: false
|
|
type: string
|
|
default: 'ghcr.io/formbricks/formbricks'
|
|
ENVIRONMENT:
|
|
description: 'The environment to deploy to'
|
|
required: true
|
|
type: string
|
|
|
|
permissions:
|
|
id-token: write
|
|
contents: write
|
|
|
|
jobs:
|
|
helmfile-deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4.2.2
|
|
|
|
- name: Tailscale
|
|
uses: tailscale/github-action@v3
|
|
with:
|
|
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
|
|
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
|
|
tags: tag:github
|
|
|
|
- name: Configure AWS Credentials
|
|
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
|
|
with:
|
|
role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }}
|
|
aws-region: "eu-central-1"
|
|
|
|
- name: Setup Cluster Access
|
|
run: |
|
|
aws eks update-kubeconfig --name formbricks-prod-eks --region eu-central-1
|
|
env:
|
|
AWS_REGION: eu-central-1
|
|
|
|
- uses: helmfile/helmfile-action@v2
|
|
name: Deploy Formbricks Cloud Prod
|
|
if: (github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch') && github.event.inputs.ENVIRONMENT == 'prod'
|
|
env:
|
|
VERSION: ${{ inputs.VERSION }}
|
|
REPOSITORY: ${{ inputs.REPOSITORY }}
|
|
FORMBRICKS_S3_BUCKET: ${{ secrets.FORMBRICKS_S3_BUCKET }}
|
|
FORMBRICKS_INGRESS_CERT_ARN: ${{ secrets.FORMBRICKS_INGRESS_CERT_ARN }}
|
|
FORMBRICKS_ROLE_ARN: ${{ secrets.FORMBRICKS_ROLE_ARN }}
|
|
with:
|
|
helm-plugins: >
|
|
https://github.com/databus23/helm-diff,
|
|
https://github.com/jkroepke/helm-secrets
|
|
helmfile-args: apply -l environment=prod
|
|
helmfile-auto-init: "false"
|
|
helmfile-workdirectory: infra/formbricks-cloud-helm
|
|
|
|
- uses: helmfile/helmfile-action@v2
|
|
name: Deploy Formbricks Cloud Stage
|
|
if: github.event_name == 'workflow_dispatch' && github.event.inputs.ENVIRONMENT == 'stage'
|
|
env:
|
|
VERSION: ${{ inputs.VERSION }}
|
|
REPOSITORY: ${{ inputs.REPOSITORY }}
|
|
FORMBRICKS_INGRESS_CERT_ARN: ${{ secrets.STAGE_FORMBRICKS_INGRESS_CERT_ARN }}
|
|
FORMBRICKS_ROLE_ARN: ${{ secrets.STAGE_FORMBRICKS_ROLE_ARN }}
|
|
with:
|
|
helm-plugins: >
|
|
https://github.com/databus23/helm-diff,
|
|
https://github.com/jkroepke/helm-secrets
|
|
helmfile-args: apply -l environment=stage
|
|
helmfile-auto-init: "false"
|
|
helmfile-workdirectory: infra/formbricks-cloud-helm
|
|
|