Merge pull request #9225 from mindsdb/eri/openai #2
This file contains 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: Build and deploy to staging | |
on: | |
push: | |
branches: | |
- main | |
# Cancel any existing runs of this workflow on the same branch/pr | |
# We always want to build/deploy/test a new commit over an older one | |
concurrency: | |
group: ${{ github.workflow_ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
# Build our docker images based on our bake file | |
runs-on: mdb-dev | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull MindsDB Github Actions | |
uses: actions/checkout@v4 | |
with: | |
repository: mindsdb/github-actions | |
path: github-actions | |
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }} | |
# Build the bakefile and push | |
- uses: ./github-actions/docker-bake | |
build_cache: | |
# Build our docker images based on our bake file | |
# This job only pushes the layers to the cache repo | |
# It's done separately so other jobs can run without waiting for this one | |
runs-on: mdb-dev | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pull MindsDB Github Actions | |
uses: actions/checkout@v4 | |
with: | |
repository: mindsdb/github-actions | |
path: github-actions | |
ssh-key: ${{ secrets.GH_ACTIONS_PULL_SSH }} | |
- uses: ./github-actions/docker-bake-cache | |
trigger_deploy: | |
# Trigger private repo to deploy to staging and dev related environments | |
runs-on: mdb-dev | |
needs: [build] | |
strategy: | |
matrix: | |
environment: [staging, hackathon, dev, alpha-dev] | |
environment: | |
name: ${{ matrix.environment }} | |
# We only want to run one deploy job for an env at a time | |
# Don't cancel in progress jobs because it may be for a different PR | |
concurrency: | |
group: deploy-${{ matrix.environment }} | |
cancel-in-progress: false | |
steps: | |
- uses: FranzDiebold/github-env-vars-action@v2 | |
- uses: convictional/[email protected] | |
with: | |
owner: mindsdb | |
repo: INTERNAL-mindsdb-build-deploy-to-kubernetes | |
github_token: ${{ secrets.REPO_DISPATCH_PAT_TOKEN }} | |
workflow_file_name: deploy-dev.yml | |
ref: main | |
client_payload: '{"image-tag-prefix": "${{ env.CI_SHA }}", "deploy-env": "${{ matrix.environment }}"}' | |
run_tests: | |
name: Run Post-Deploy Tests | |
needs: [trigger_deploy] | |
uses: ./.github/workflows/test_on_deploy.yml | |
secrets: inherit |