Update mlflow_experiment.json #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CD | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'main' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| environment: [acc, prd] | |
| environment: ${{ matrix.environment }} | |
| permissions: | |
| contents: write # to push tag | |
| env: | |
| DATABRICKS_HOST: ${{ vars.DATABRICKS_HOST }} | |
| DATABRICKS_CLIENT_ID: ${{ secrets.DATABRICKS_CLIENT_ID }} | |
| DATABRICKS_CLIENT_SECRET: ${{ secrets.DATABRICKS_CLIENT_SECRET }} | |
| steps: | |
| - name: Checkout Source Code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 | |
| - name: Install Databricks CLI | |
| uses: databricks/setup-cli@49580195afe1ccb06d195764a1d0ae9fabfe2edd #v0.246.0 | |
| with: | |
| version: 0.246.0 | |
| - name: Configure Databricks CLI | |
| run: | | |
| mkdir -p ~/.databricks | |
| cat > ~/.databrickscfg << EOF | |
| [marvelous] | |
| host = ${{ vars.DATABRICKS_HOST }} | |
| client_id = ${{ secrets.DATABRICKS_CLIENT_ID }} | |
| client_secret = ${{ secrets.DATABRICKS_CLIENT_SECRET }} | |
| EOF | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@0c5e2b8115b80b4c7c5ddf6ffdd634974642d182 #v5.4.1 | |
| - name: Deploy to Databricks | |
| env: | |
| DATABRICKS_BUNDLE_ENV: ${{ matrix.environment }} | |
| run: | | |
| databricks bundle deploy \ | |
| --var="git_sha=${{ github.sha }}" \ | |
| --var="branch=${{ github.ref_name }}" | |
| if [ "${{ matrix.environment }}" = "prd" ]; then | |
| echo "VERSION=$(cat version.txt)" | |
| git tag $VERSION | |
| git push origin $VERSION | |
| fi |