Skip to content

fix

fix #3

on:

Check failure on line 1 in .github/workflows/build-push-deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-push-deploy.yml

Invalid workflow file

(Line: 55, Col: 15): Expected format {org}/{repo}[/path]@ref. Actual 'mindsdb/github-actions/get-deploy-labels'
workflow_call:
inputs:
service-name:
description: "Name of the service to build. Used as the default image name and src dir unless 'image-name' or 'src-path' are used."
type: string
required: true
environment-name:
description: "The backend environment we are building for (API calls are pointed to). This should be one of (development, staging, production)."
type: string
required: true
docker-build-args:
description: "Extra args passed to 'docker build'."
type: string
required: false
docker-image-ref:
description: "The version number or sha used in creating image tag"
type: string
required: false
#secrets:
jobs:
changes:
name: Filter changed files
runs-on: mdb-dev
outputs:
not-docs: ${{ steps.filter.outputs.not-docs }}
concurrency:
group: ${{ github.workflow_ref }}
cancel-in-progress: true
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
predicate-quantifier: "every"
filters: |
not-docs:
- '!docs/**'
- '!**/*.md'
# Looks for labels like "deploy-to-<env>" attached to a PR so we can deploy to those envs
get-deploy-labels:
name: Get Deploy Envs
runs-on: mdb-dev
concurrency:
group: ${{ github.workflow_ref }}
cancel-in-progress: true
environment:
name: ${{ github.event.pull_request.head.repo.fork && 'manual-approval' || '' }}
outputs:
deploy-envs: ${{ steps.get-labels.outputs.deploy-envs }}
steps:
- id: get-labels
uses: mindsdb/github-actions/get-deploy-labels
# Build our docker images based on our bake file
build:
runs-on: mdb-dev
needs: [get-deploy-labels]
if: needs.get-deploy-labels.outputs.deploy-envs != '[]'
concurrency:
group: ${{ github.workflow_ref }}
cancel-in-progress: true
env:
AWS_REGION: us-east-1
steps:
- uses: ./github-actions/build-push-ecr
with:
module-name: ${{ inputs.service-name }}
build-for-environment: development
# Push cache layers to docker registry
# This is separate to the build step so we can do other stuff in parallel
# build-cache:
# name: Push Docker Cache
# runs-on: mdb-dev
# needs: [build]
# concurrency:
# group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}-cache
# cancel-in-progress: true
# steps:
# - uses: actions/checkout@v4
# with:
# ref: ${{ github.event.pull_request.head.sha }}
# - name: Pull MindsDB Github Actions
# uses: actions/checkout@v4
# with:
# repository: mindsdb/github-actions
# path: github-actions
# # Build the bakefile and push
# - uses: ./github-actions/docker-bake
# with:
# git-sha: ${{ github.event.pull_request.head.sha }}
# target: cloud-cpu
# platforms: linux/amd64
# push-cache: true
# cache-only: true
# Call our deployment workflow, so long as this is not a forked PR
# This will run the deployment workflow in the base branch, not in the PR.
# So if you change the deploy workflow in your PR, the changes won't be reflected in this run.
# deploy:
# name: Deploy
# needs: [build, get-deploy-labels]
# if: needs.get-deploy-labels.outputs.deploy-envs != '[]'
# uses: ./.github/workflows/deploy.yml
# with:
# deploy-envs: ${{ needs.get-deploy-labels.outputs.deploy-envs }}
# image-tag: ${{ github.event.pull_request.head.sha }}
# secrets: inherit