Skip to content

"yaml: line 108: did not find expected ',' or ']'" running install.py #1085

"yaml: line 108: did not find expected ',' or ']'" running install.py

"yaml: line 108: did not find expected ',' or ']'" running install.py #1085

name: Kubernetes Deploy
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Select Environment
options:
- staging
- production
default: staging
issue_comment:
types: [created]
inputs:
environment:
type: choice
description: Select Environment
options:
- staging
- production
default: staging
jobs:
publishimages:
needs: [pr_commented]
if: "github.event.issue.pull_request == null ||
(
github.event.issue.pull_request != null && contains(github.event.comment.body, '/deploy') &&
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' )
)"
uses: ./.github/workflows/publish_docker_images.yaml
name: Publish Images
secrets:
GOOGLE_PROJECT_NAME: ${{ secrets.GOOGLE_PROJECT_NAME }}
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
pr_commented:
# This job only runs for pull request comments
name: PR Comment Deploy
runs-on: ubuntu-latest
steps:
- run: |
echo A comment on PR $NUMBER
env:
NUMBER: ${{ github.event.issue.number }}
- name: Check that comments belongs to org/repo
if: "github.event.issue.pull_request != null && contains(github.event.comment.body, '/deploy') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'MEMBER' )"
run: |
echo "valid_comment=true" >> $GITHUB_ENV
- uses: xt0rted/pull-request-comment-branch@v1
if: "github.event.issue.pull_request"
id: comment-branch
- name: see vars
run: |
echo ${{ github.ref }}
echo ${{ github }}
echo ${{ github.event.issue.pull_request }}
echo ${{ github.event.issue.pull_request.base_ref }}
echo ${{ steps.comment-branch.outputs.head_ref }}
echo '${{ toJSON(github) }}'
- name: Get time
uses: actions/github-script@v3
id: get-time
with:
script: return new Date().toString()
result-encoding: string
- name: Comment PR
uses: NejcZdovc/comment-pr@v1
if: "env.valid_comment"
with:
message: "This PR is now Being Deployed.... 🚀🚀🚀🚀 \n
Execution time: `${{steps.get-time.outputs.result}}` \n
To See Deployment Progress go to: https://github.com/diffgram/diffgram/actions/runs/${{ github.run_id }}"
github_token: ${{secrets.GITHUB_TOKEN}}
identifier: "PR_DEPLOY_STARTED"
single_comment: false
Production-Deploy-Azure-Kubernetes:
runs-on: ubuntu-latest
needs: [publishimages]
environment: production
if: "((!github.event.issue.pull_request) ||
(github.event.issue.pull_request != null && contains(github.event.comment.body, '/deploy') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'MEMBER' ))) && github.event.inputs.environment == 'production'"
env:
CLOUD_STORAGE_BUCKET: ${{ secrets.CLOUD_STORAGE_BUCKET }}
DIFFGRAM_SYSTEM_MODE: ${{ secrets.DIFFGRAM_SYSTEM_MODE }}
EMAIL_VALIDATION: ${{ secrets.EMAIL_VALIDATION }}
HUB_SPOT_KEY: ${{ secrets.HUB_SPOT_KEY }}
INTER_SERVICE_SECRET: ${{ secrets.INTER_SERVICE_SECRET }}
MAILGUN_KEY: ${{ secrets.MAILGUN_KEY }}
ML__CLOUD_STORAGE_BUCKET: ${{ secrets.ML__CLOUD_STORAGE_BUCKET }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }}
USER_PASSWORDS_SECRET: ${{ secrets.USER_PASSWORDS_SECRET }}
_ANALYTICS_WRITE_KEY: ${{ secrets._ANALYTICS_WRITE_KEY }}
DIFFGRAM_STATIC_STORAGE_PROVIDER: ${{ secrets.DIFFGRAM_STATIC_STORAGE_PROVIDER }}
SERVICE_ACCOUNT_FULL_PATH: ${{ secrets.SERVICE_ACCOUNT_FULL_PATH }}
FERNET_KEY: ${{ secrets.FERNET_KEY }}
URL_BASE: ${{ secrets.URL_BASE }}
WALRUS_SERVICE_URL_BASE: ${{ secrets.WALRUS_SERVICE_URL_BASE }}
PROCESS_MEDIA_TRY_BLOCK_ON: ${{ secrets.PROCESS_MEDIA_TRY_BLOCK_ON }}
PROCESS_MEDIA_REMOTE_QUEUE_ON: ${{ secrets.PROCESS_MEDIA_REMOTE_QUEUE_ON }}
PROCESS_MEDIA_ENQUEUE_LOCALLY_IMMEDIATELY: ${{ secrets.PROCESS_MEDIA_ENQUEUE_LOCALLY_IMMEDIATELY }}
WEBHOOKS_URL_BASE: ${{ secrets.WEBHOOKS_URL_BASE }}
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
GOOGLE_APPLICATION_CREDENTIALS: ~/gcloud-service-key.json
DOCKER_IMAGE_PROJECT_NAME: ${{ secrets.DOCKER_IMAGE_PROJECT_NAME }}
DIFFGRAM_INSTALL_FINGERPRINT: ${{ secrets.DIFFGRAM_INSTALL_FINGERPRINT }}
DIFFGRAM_VERSION_TAG: ${{ github.event.inputs.release }}
DIFFGRAM_HOST_OS: ${{ secrets.DIFFGRAM_HOST_OS }}
DATABASE_CONNECTION_POOL_SIZE: ${{ secrets.DATABASE_CONNECTION_POOL_SIZE }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
EMAIL_DOMAIN_NAME: ${{ secrets.EMAIL_DOMAIN_NAME }}
ALLOW_EVENTHUB: ${{ secrets.ALLOW_EVENTHUB }}
IS_OPEN_SOURCE: ${{ secrets.IS_OPEN_SOURCE }}
ALLOW_STRIPE_BILLING: ${{ secrets.ALLOW_STRIPE_BILLING }}
DIFFGRAM_MINIO_ENDPOINT_URL: ${{secrets.DIFFGRAM_MINIO_ENDPOINT_URL}}
DIFFGRAM_MINIO_ACCESS_KEY_ID: ${{secrets.DIFFGRAM_MINIO_ACCESS_KEY_ID}}
DIFFGRAM_MINIO_ACCESS_KEY_SECRET: ${{secrets.DIFFGRAM_MINIO_ACCESS_KEY_SECRET}}
DIFFGRAM_MINIO_DISABLED_SSL_VERIFY: ${{secrets.DIFFGRAM_MINIO_DISABLED_SSL_VERIFY}}
SIGNED_URL_CACHE_MINIMUM_SECONDS_VALID: ${{secrets.SIGNED_URL_CACHE_MINIMUM_SECONDS_VALID}}
SIGNED_URL_CACHE_NEW_OFFSET_SECONDS_VALID: ${{secrets.SIGNED_URL_CACHE_NEW_OFFSET_SECONDS_VALID}}
RABBITMQ_DEFAULT_USER: ${{secrets.RABBITMQ_DEFAULT_USER}}
RABBITMQ_DEFAULT_PASS: ${{secrets.RABBITMQ_DEFAULT_PASS}}
RABBITMQ_USE_SSL: ${{secrets.RABBITMQ_USE_SSL}}
ERLANG_COOKIE: ${{secrets.ERLANG_COOKIE}}
SMTP_USERNAME: ${{secrets.SMTP_USERNAME}}
SMTP_PASSWORD: ${{secrets.SMTP_PASSWORD}}
SMTP_HOST: ${{secrets.SMTP_HOST}}
SMTP_PORT: ${{secrets.SMTP_PORT}}
SMTP_FROM_EMAIL: ${{secrets.SMTP_FROM_EMAIL}}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_CONTEXT: true
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Extract branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
# Use branch name for whatever purpose
- run: echo ${BRANCH_NAME}
- name: Clone Helm Chart for Diffgram
uses: actions/checkout@master
with:
repository: diffgram/diffgram-helm
- name: Create Diffgram Version Production From Tag or Branch
run: |
echo "diffgram_version=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Prepare app.yaml for helm chart.
uses: microsoft/variable-substitution@v1
with:
files: 'values.yaml'
env:
diffgramVersion: ${{ env.diffgram_version }}
diffgramEdition: opencore
diffgramDomain: app.diffgram.com
useCertManager: true
useTls: true
dbSettings.dbProvider: azure
dbSettings.azureSqlEndpoint: ${{secrets.AZURE_SQL_ENDPOINT}}
dbSettings.dbUser: ${{secrets.AZURE_DB_USER}}
dbSettings.dbName: ${{secrets.AZURE_DB_NAME}}
dbSettings.dbPassword: ${{secrets.AZURE_DB_PASSWORD}}
diffgramSecrets.STRIPE_API_KEY: ${{secrets.STRIPE_API_KEY}}
diffgramSecrets._ANALYTICS_WRITE_KEY: ${{secrets._ANALYTICS_WRITE_KEY}}
diffgramSecrets.MAILGUN_KEY: ${{secrets.MAILGUN_KEY}}
diffgramSecrets.HUB_SPOT_KEY: ${{secrets.HUB_SPOT_KEY}}
diffgramSecrets.SECRET_KEY: ${{secrets.SECRET_KEY}}
diffgramSecrets.FERNET_KEY: ${{secrets.FERNET_KEY}}
diffgramSecrets.INTER_SERVICE_SECRET: ${{secrets.INTER_SERVICE_SECRET}}
diffgramSecrets.USER_PASSWORDS_SECRET: ${{secrets.USER_PASSWORDS_SECRET}}
diffgramSecrets.SERVICE_ACCOUNT_JSON_B64: ${{secrets.SERVICE_ACCOUNT_JSON_B64}}
diffgramSecrets.DIFFGRAM_AZURE_CONNECTION_STRING: ${{secrets.DIFFGRAM_AZURE_CONNECTION_STRING}}
diffgramSettings.USERDOMAIN: kubernetes_production
diffgramSettings.DIFFGRAM_SYSTEM_MODE: production
diffgramSettings.DIFFGRAM_STATIC_STORAGE_PROVIDER: azure
diffgramSettings.DIFFGRAM_AZURE_CONTAINER_NAME: ${{secrets.DIFFGRAM_AZURE_CONTAINER_NAME}}
diffgramSettings.ML__DIFFGRAM_AZURE_CONTAINER_NAME: ${{secrets.ML__DIFFGRAM_AZURE_CONTAINER_NAME}}
diffgramSettings.WALRUS_SERVICE_URL_BASE: ${{secrets.WALRUS_SERVICE_URL_BASE}}
diffgramSettings.DIFFGRAM_INSTALL_FINGERPRINT: ${{secrets.DIFFGRAM_INSTALL_FINGERPRINT}}
diffgramSettings.DIFFGRAM_HOST_OS: ${{secrets.DIFFGRAM_HOST_OS}}
diffgramSettings.DIFFGRAM_VERSION_TAG: ${{secrets.DIFFGRAM_VERSION_TAG}}
diffgramSettings.DATABASE_CONNECTION_POOL_SIZE: ${{secrets.DATABASE_CONNECTION_POOL_SIZE}}
diffgramSettings.PROCESS_MEDIA_NUM_VIDEO_THREADS: ${{secrets.PROCESS_MEDIA_NUM_VIDEO_THREADS}}
diffgramSettings.PROCESS_MEDIA_NUM_FRAME_THREADS: ${{secrets.PROCESS_MEDIA_NUM_FRAME_THREADS}}
diffgramSettings.NEW_RELIC_LICENSE_KEY: ${{secrets.NEW_RELIC_LICENSE_KEY}}
diffgramSettings.EMAIL_DOMAIN_NAME: ${{secrets.EMAIL_DOMAIN_NAME}}
diffgramSettings.ALLOW_EVENTHUB: ${{secrets.ALLOW_EVENTHUB}}
diffgramSettings.EMAIL_VALIDATION: ${{secrets.EMAIL_VALIDATION}}
diffgramSettings.IS_OPEN_SOURCE: ${{secrets.IS_OPEN_SOURCE}}
diffgramSettings.ALLOW_STRIPE_BILLING: ${{secrets.ALLOW_STRIPE_BILLING}}
diffgramSettings.DIFFGRAM_MINIO_ENDPOINT_URL: ${{secrets.DIFFGRAM_MINIO_ENDPOINT_URL}}
diffgramSettings.DIFFGRAM_MINIO_ACCESS_KEY_ID: ${{secrets.DIFFGRAM_MINIO_ACCESS_KEY_ID}}
diffgramSettings.DIFFGRAM_MINIO_ACCESS_KEY_SECRET: ${{secrets.DIFFGRAM_MINIO_ACCESS_KEY_SECRET}}
diffgramSettings.DIFFGRAM_MINIO_DISABLED_SSL_VERIFY: ${{secrets.DIFFGRAM_MINIO_DISABLED_SSL_VERIFY}}
diffgramSettings.SIGNED_URL_CACHE_MINIMUM_SECONDS_VALID: ${{secrets.SIGNED_URL_CACHE_MINIMUM_SECONDS_VALID}}
diffgramSettings.SIGNED_URL_CACHE_NEW_OFFSET_SECONDS_VALID: ${{secrets.SIGNED_URL_CACHE_NEW_OFFSET_SECONDS_VALID}}
diffgramSettings.SMTP_HOST: ${{secrets.SMTP_HOST}}
diffgramSettings.SMTP_PORT: ${{secrets.SMTP_PORT}}
diffgramSettings.SMTP_USERNAME: ${{secrets.SMTP_USERNAME}}
diffgramSettings.SMTP_FROM_EMAIL: ${{secrets.SMTP_FROM_EMAIL}}
diffgramSecrets.SMTP_PASSWORD: ${{secrets.SMTP_PASSWORD}}
diffgramSettings.RABBITMQ_USE_SSL: ${{secrets.RABBITMQ_USE_SSL}}
rabbitmq.auth.username: ${{secrets.RABBITMQ_DEFAULT_USER}}
rabbitmq.auth.password: ${{secrets.RABBITMQ_DEFAULT_PASS}}
rabbitmq.auth.erlangCookie: ${{secrets.ERLANG_COOKIE}}
eventHandlersService.requests.memory: "1G"
eventHandlersService.limits.memory: "2G"
eventHandlersService.requests.cpu: ".5"
eventHandlersService.limits.cpu: ".5"
walrusService.requests.memory: "6G"
walrusService.limits.memory: "12G"
walrusService.requests.cpu: "1"
walrusService.limits.cpu: "2"
defaultService.requests.memory: "1G"
defaultService.limits.memory: "2G"
defaultService.requests.cpu: ".5"
frontendService.requests.memory: ".5G"
frontendService.limits.memory: ".5G"
frontendService.requests.cpu: ".25"
defaultService.numReplicas: 2
frontendService.numReplicas: 1
walrusService.numReplicas: 1
nodeGroupLabel: diffgram-apps
- name: Check values.yaml
run: cat values.yaml
# Set the target Azure Kubernetes Service (AKS) cluster.
- name: Set Kubernetes Cluster Context on AKS
uses: azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_CLUSTER_RESOURCE_GROUP }}
- name: Upgrade Diffgram with Helm
run: |
helm dependency update
helm upgrade --install diffgram . -f values.yaml --namespace diffgram-production
Staging-Deploy-Azure-Kubernetes:
runs-on: ubuntu-latest
needs: [publishimages]
environment: staging
if: "(!github.event.issue.pull_request && github.event.inputs.environment == 'staging') ||
(github.event.issue.pull_request != null && contains(github.event.comment.body, '/deploy') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'MEMBER' ) && github.event.inputs.environment == 'staging')"
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
CLOUD_STORAGE_BUCKET: ${{ secrets.CLOUD_STORAGE_BUCKET }}
DIFFGRAM_SYSTEM_MODE: ${{ secrets.DIFFGRAM_SYSTEM_MODE }}
EMAIL_VALIDATION: ${{ secrets.EMAIL_VALIDATION }}
HUB_SPOT_KEY: ${{ secrets.HUB_SPOT_KEY }}
INTER_SERVICE_SECRET: ${{ secrets.INTER_SERVICE_SECRET }}
MAILGUN_KEY: ${{ secrets.MAILGUN_KEY }}
ML__CLOUD_STORAGE_BUCKET: ${{ secrets.ML__CLOUD_STORAGE_BUCKET }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
STRIPE_API_KEY: ${{ secrets.STRIPE_API_KEY }}
USER_PASSWORDS_SECRET: ${{ secrets.USER_PASSWORDS_SECRET }}
_ANALYTICS_WRITE_KEY: ${{ secrets._ANALYTICS_WRITE_KEY }}
DIFFGRAM_STATIC_STORAGE_PROVIDER: ${{ secrets.DIFFGRAM_STATIC_STORAGE_PROVIDER }}
SERVICE_ACCOUNT_FULL_PATH: ${{ secrets.SERVICE_ACCOUNT_FULL_PATH }}
FERNET_KEY: ${{ secrets.FERNET_KEY }}
URL_BASE: ${{ secrets.URL_BASE }}
WALRUS_SERVICE_URL_BASE: ${{ secrets.WALRUS_SERVICE_URL_BASE }}
PROCESS_MEDIA_TRY_BLOCK_ON: ${{ secrets.PROCESS_MEDIA_TRY_BLOCK_ON }}
PROCESS_MEDIA_REMOTE_QUEUE_ON: ${{ secrets.PROCESS_MEDIA_REMOTE_QUEUE_ON }}
PROCESS_MEDIA_ENQUEUE_LOCALLY_IMMEDIATELY: ${{ secrets.PROCESS_MEDIA_ENQUEUE_LOCALLY_IMMEDIATELY }}
WEBHOOKS_URL_BASE: ${{ secrets.WEBHOOKS_URL_BASE }}
GOOGLE_SERVICE_ACCOUNT_ENCODED: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_ENCODED }}
GOOGLE_APPLICATION_CREDENTIALS: ~/gcloud-service-key.json
DOCKER_IMAGE_PROJECT_NAME: ${{ secrets.DOCKER_IMAGE_PROJECT_NAME }}
DATABASE_CONNECTION_POOL_SIZE: ${{ secrets.DATABASE_CONNECTION_POOL_SIZE }}
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }}
EMAIL_DOMAIN_NAME: ${{ secrets.EMAIL_DOMAIN_NAME }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
ALLOW_EVENTHUB: ${{ secrets.ALLOW_EVENTHUB }}
IS_OPEN_SOURCE: ${{ secrets.IS_OPEN_SOURCE }}
ALLOW_STRIPE_BILLING: ${{ secrets.ALLOW_STRIPE_BILLING }}
RABBITMQ_DEFAULT_USER: ${{ secrets.RABBITMQ_DEFAULT_USER }}
RABBITMQ_DEFAULT_PASS: ${{ secrets.RABBITMQ_DEFAULT_PASS }}
RABBITMQ_USE_SSL: ${{ secrets.RABBITMQ_USE_SSL }}
SMTP_USERNAME: ${{secrets.SMTP_USERNAME}}
SMTP_PASSWORD: ${{secrets.SMTP_PASSWORD}}
SMTP_HOST: ${{secrets.SMTP_HOST}}
SMTP_PORT: ${{secrets.SMTP_PORT}}
SMTP_FROM_EMAIL: ${{secrets.SMTP_FROM_EMAIL}}
steps:
- uses: xt0rted/pull-request-comment-branch@v1
if: "github.event.issue.pull_request"
id: comment-branch
- name: Check out repository code From PR Branch
if: "github.event.issue.pull_request"
uses: actions/checkout@v2
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: Check out repository code
if: "!github.event.issue.pull_request"
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- run: |
ls -a ./
echo "----"
ls -a ./.github
echo "----"
ls -a ./.github/workflows
echo "----"
cd ./.github/workflows
pwd
- name: Extract branch name
if: github.event_name != 'pull_request'
shell: bash
run: echo "::set-env name=BRANCH_NAME::$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
# Use branch name for whatever purpose
- run: echo ${BRANCH_NAME}
- name: Clone Helm Chart for Diffgram
uses: actions/checkout@master
with:
repository: diffgram/diffgram-helm
- name: Create Diffgram Version Production From Tag or Branch
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Create Diffgram Version Production From PR
if: "github.event.issue.pull_request"
run: |
echo "diffgram_version=${{ steps.comment-branch.outputs.head_ref }}" >> $GITHUB_ENV
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4.4.1
with:
slug-maxlength: 30
- name: Create Diffgram Domain Slug from Manual Deploy
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_domain_slug=${{ env.GITHUB_REF_SLUG }}" >> $GITHUB_ENV
- uses: gacts/github-slug@v1
if: "github.event.issue.pull_request"
id: slug
with:
# replace value in "to-slug" this on your choice
to-slug: ${{ steps.comment-branch.outputs.head_ref }}
- name: Truncate String
if: "github.event.issue.pull_request"
uses: 2428392/gh-truncate-string-action@v1.0.0
id: truncatedString
with:
stringToTruncate: ${{ steps.slug.outputs.slug }}
maxLength: 30
- name: Echo string
if: "github.event.issue.pull_request"
run: echo ${{ steps.truncatedString.outputs.string }}
- name: Create Diffgram Domain Slug from pr
if: "github.event.issue.pull_request"
run: |
echo "diffgram_domain_slug=${{ steps.truncatedString.outputs.string }}" >> $GITHUB_ENV
- name: Create Diffgram Domain Slug from pr
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_domain_slug=${{ steps.truncatedString.outputs.string }}" >> $GITHUB_ENV
- uses: mad9000/actions-find-and-replace-string@2
if: "!github.event.issue.pull_request"
id: finalDomain
with:
source: ${{ env.GITHUB_REF_SLUG }}
find: '.'
replace: '' # replace it with a blank string (ie. removing it)
- uses: mad9000/actions-find-and-replace-string@2
if: "!github.event.issue.pull_request"
id: finalDomain2
with:
source: ${{ steps.finalDomain.outputs.value }}
find: '.'
replace: '' # replace it with a blank string (ie. removing it)
- run: echo ${{ steps.finalDomain2.outputs.value }}
- name: Create Diffgram Domain Slug from Dispatch
if: "!github.event.issue.pull_request"
run: |
echo "diffgram_domain_slug=${{ steps.finalDomain2.outputs.value }}" >> $GITHUB_ENV
- name: Prepare app.yaml for helm chart.
uses: microsoft/variable-substitution@v1
with:
files: 'values.yaml'
env:
diffgramVersion: ${{ env.diffgram_version }}
diffgramEdition: opencore
diffgramDomain: ${{ env.diffgram_domain_slug }}.dataannotation.info
useCertManager: true
useTls: true
dbSettings.dbProvider: azure
dbSettings.azureSqlEndpoint: ${{secrets.AZURE_SQL_ENDPOINT}}
dbSettings.dbUser: ${{secrets.AZURE_DB_USER}}
dbSettings.dbName: db-staging-${{ env.diffgram_version }}
dbSettings.dbPassword: ${{secrets.AZURE_DB_PASSWORD}}
diffgramSecrets.STRIPE_API_KEY: ${{secrets.STRIPE_API_KEY}}
diffgramSecrets._ANALYTICS_WRITE_KEY: ${{secrets._ANALYTICS_WRITE_KEY}}
diffgramSecrets.MAILGUN_KEY: ${{secrets.MAILGUN_KEY}}
diffgramSecrets.HUB_SPOT_KEY: ${{secrets.HUB_SPOT_KEY}}
diffgramSecrets.SECRET_KEY: ${{secrets.SECRET_KEY}}
diffgramSecrets.INTER_SERVICE_SECRET: ${{secrets.INTER_SERVICE_SECRET}}
diffgramSecrets.USER_PASSWORDS_SECRET: ${{secrets.USER_PASSWORDS_SECRET}}
diffgramSecrets.SERVICE_ACCOUNT_JSON_B64: ${{secrets.SERVICE_ACCOUNT_JSON_B64}}
diffgramSecrets.DIFFGRAM_AZURE_CONNECTION_STRING: ${{secrets.DIFFGRAM_AZURE_CONNECTION_STRING}}
diffgramSettings.USERDOMAIN: kubernetes_production
diffgramSettings.DIFFGRAM_SYSTEM_MODE: production
diffgramSettings.DIFFGRAM_STATIC_STORAGE_PROVIDER: azure
diffgramSettings.WALRUS_SERVICE_URL_BASE: ${{secrets.WALRUS_SERVICE_URL_BASE}}
diffgramSettings.DIFFGRAM_AZURE_CONTAINER_NAME: staging1
diffgramSettings.ML__DIFFGRAM_AZURE_CONTAINER_NAME: staging1
diffgramSettings.DIFFGRAM_INSTALL_FINGERPRINT: ${{secrets.DIFFGRAM_INSTALL_FINGERPRINT}}
diffgramSettings.DIFFGRAM_HOST_OS: ${{secrets.DIFFGRAM_HOST_OS}}
diffgramSettings.DIFFGRAM_VERSION_TAG: ${{secrets.DIFFGRAM_VERSION_TAG}}
diffgramSettings.DATABASE_CONNECTION_POOL_SIZE: ${{secrets.DATABASE_CONNECTION_POOL_SIZE}}
diffgramSettings.PROCESS_MEDIA_NUM_VIDEO_THREADS: ${{secrets.PROCESS_MEDIA_NUM_VIDEO_THREADS}}
diffgramSettings.PROCESS_MEDIA_NUM_FRAME_THREADS: ${{secrets.PROCESS_MEDIA_NUM_FRAME_THREADS}}
diffgramSettings.NEW_RELIC_LICENSE_KEY: ${{secrets.NEW_RELIC_LICENSE_KEY}}
diffgramSettings.EMAIL_DOMAIN_NAME: ${{secrets.EMAIL_DOMAIN_NAME}}
diffgramSettings.ALLOW_EVENTHUB: ${{secrets.ALLOW_EVENTHUB}}
diffgramSettings.EMAIL_VALIDATION: ${{secrets.EMAIL_VALIDATION}}
diffgramSettings.IS_OPEN_SOURCE: ${{secrets.IS_OPEN_SOURCE}}
diffgramSettings.ALLOW_STRIPE_BILLING: ${{secrets.ALLOW_STRIPE_BILLING}}
diffgramSettings.RABBITMQ_USE_SSL: ${{secrets.RABBITMQ_USE_SSL}}
diffgramSettings.SMTP_HOST: ${{secrets.SMTP_HOST}}
diffgramSettings.SMTP_PORT: ${{secrets.SMTP_PORT}}
diffgramSettings.SMTP_USERNAME: ${{secrets.SMTP_USERNAME}}
diffgramSettings.SMTP_FROM_EMAIL: ${{secrets.SMTP_FROM_EMAIL}}
diffgramSecrets.SMTP_PASSWORD: ${{secrets.SMTP_PASSWORD}}
rabbitmq.auth.username: ${{secrets.RABBITMQ_DEFAULT_USER}}
rabbitmq.auth.password: ${{secrets.RABBITMQ_DEFAULT_PASS}}
eventHandlersService.requests.memory: "6G"
eventHandlersService.limits.memory: "6G"
eventHandlersService.requests.cpu: "1"
eventHandlersService.limits.cpu: "1"
defaultService.numReplicas: 1
frontendService.numReplicas: 1
walrusService.numReplicas: 1
defaultService.requests.cpu: "1"
defaultService.requests.memory: "1G"
defaultService.limits.cpu: "1"
defaultService.limits.memory: "1G"
frontendService.requests.cpu: "1"
frontendService.requests.memory: "1G"
frontendService.limits.cpu: "1"
frontendService.limits.memory: "1G"
walrusService.requests.cpu: "1"
walrusService.requests.memory: "1G"
walrusService.limits.cpu: "1"
walrusService.limits.memory: "1G"
nodeGroupLabel: null
- name: Check values.yaml
run: cat values.yaml
- name: Get time
if: "github.event.issue.pull_request != null && contains(github.event.comment.body, '/deploy') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'MEMBER' )"
uses: actions/github-script@v3
id: get-time
with:
script: return new Date().toString()
result-encoding: string
# Set the target Azure Kubernetes Service (AKS) cluster.
- name: Set Kubernetes Cluster Context on AKS
uses: azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
resource-group: ${{ secrets.AKS_CLUSTER_RESOURCE_GROUP }}
- name: helm version
run: helm version
- name: Upgrade Diffgram with Helm
run: |
kubectl create namespace diffgram-staging-${{ env.diffgram_domain_slug }}ns --dry-run=client -o yaml | kubectl apply -f -
helm dependency update
helm upgrade --install diffgram . -f values.yaml --namespace diffgram-staging-${{ env.diffgram_domain_slug }}ns
- name: Comment PR
if: ${{ failure() && github.event.issue.pull_request}}
uses: NejcZdovc/comment-pr@v1
with:
message: "❌ This PR has failed to deploy \n
Execution time: `${{steps.get-time.outputs.result}}` \n
Details: https://github.com/diffgram/diffgram/actions/runs/${{ github.run_id }}"
github_token: ${{secrets.GITHUB_TOKEN}}
single_comment: false
- name: Comment PR
if: "github.event.issue.pull_request != null && contains(github.event.comment.body, '/deploy') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'COLLABORATOR' ||
github.event.comment.author_association == 'MEMBER' )"
uses: NejcZdovc/comment-pr@v1
with:
message: "✔️ This PR Has been Deployed in: https://${{ env.diffgram_domain_slug }}.dataannotation.info/user/login \n
Execution time: `${{steps.get-time.outputs.result}}`"
github_token: ${{secrets.GITHUB_TOKEN}}
single_comment: false