Skip to content

Commit

Permalink
Test deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
aamend committed Mar 8, 2024
1 parent cb0410f commit e330541
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
name: publish

env:
DB_AWS_DEMO_TOKEN: ${{ secrets.DB_AWS_DEMO_TOKEN }}
DB_AWS_FIELD_TOKEN: ${{ secrets.DB_AWS_FIELD_TOKEN }}
DB_GCP_TOKEN: ${{ secrets.DB_GCP_TOKEN }}
DB_PROFILE: ${{ secrets.DB_PROFILE }}

on:
workflow_dispatch:
inputs:
environment:
type: choice
db_profile:
type: string
description: 'Databricks environment to publish HTML from'
options:
- e2-demo-field-eng.cloud.databricks.com
- e2-demo-west.cloud.databricks.com
- 6177827686947384.4.gcp.databricks.com
path:
default: DEMO
db_path:
type: string
description: 'Repository path on databricks environment'
required: true
Expand Down Expand Up @@ -50,21 +45,18 @@ jobs:
run: |
import os
import json
from databricks.solution import Accelerator
db_host = ${{ github.event.inputs.environment }}
if db_host == 'e2-demo-field-eng.cloud.databricks.com':
db_token = os.environ['DB_AWS_FIELD_TOKEN']
elif db_host == 'e2-demo-west.cloud.databricks.com':
db_token = os.environ['DB_AWS_DEMO_TOKEN']
elif db_host == '6177827686947384.4.gcp.databricks.com':
db_token = os.environ['DB_GCP_TOKEN']
else:
exit(1)
environments = json.loads(os.environ['DB_PROFILES'])
if '${{ github.event.repository.db_profile }}' not in environments:
raise Exception('Profile is not supported. Please check secret information')
environment = environments['${{ github.event.repository.db_profile }}']
Accelerator(
db_host=db_host,
db_token=db_token,
db_host=environment['host'],
db_token=environment['token'],
db_path='${{ github.event.inputs.path }}',
db_name='${{ github.event.repository.name }}',
).release()
Expand Down

0 comments on commit e330541

Please sign in to comment.