Skip to content

deploy-solution-sites #3

deploy-solution-sites

deploy-solution-sites #3

Workflow file for this run

name: deploy-solution-sites
on:
workflow_dispatch:
inputs:
name:
type: string
description: 'Code name of the solution accelerator to deploy'
required: true
environment:
type: choice
description: 'Databricks environment to publish HTML from'
options:
- https://e2-demo-field-eng.cloud.databricks.com
- https://e2-demo-west.cloud.databricks.com
- https://6177827686947384.4.gcp.databricks.com
path:
type: string
description: 'Repository path on databricks environment'
required: true
permissions:
contents: write
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Configure git
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)"
- name: Retrieve latest site
run: |
git subtree split --prefix site/ -b gh-pages
git push -f origin gh-pages:gh-pages
git branch -D gh-pages
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.9"
- name: Configure Python
uses: actions/cache@v2
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
${{ runner.os }}-pip-
- name: Install pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: pip install -U -r requirements.txt
- name: Publish solution accelerator
run: |
export DB_HOST=${{ github.event.inputs.environment }}
case ${DB_HOST} in
"https://e2-demo-field-eng.cloud.databricks.com")
export DB_TOKEN=${{ secrets.DB_AWS_FIELD_TOKEN }}
;;
"https://e2-demo-west.cloud.databricks.com")
export DB_TOKEN=${{ secrets.DB_AWS_DEMO_TOKEN }}
;;
"https://6177827686947384.4.gcp.databricks.com")
export DB_TOKEN=${{ secrets.DB_GCP_TOKEN }}
;;
*)
echo "Unsupported environment"
exit 1
;;
esac
python databricks.py --path ${{ github.event.inputs.path }} --name ${{ github.event.inputs.name }}
- name: Deploy solution to github page
run: |
git add .
git commit -a -m "Adding solution [${{ github.event.inputs.name }}]" --reset-author
git push
git subtree push --prefix site/ origin gh-pages