Skip to content

feat: completion spark job #87

feat: completion spark job

feat: completion spark job #87

name: Radicalbit Bot
on:
issue_comment:
types: [created, edited, deleted]
env:
AVAILABLE_COMMANDS: '["/build-api","/build-spark","/build-ui","/build-migrations","/build-all"]'
jobs:
build-api:
if: ${{ github.event.comment.body == '/build-api' || github.event.comment.body == '/build-all' }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/docker.yaml@v1
with:
push: false
context: ./api
image: radicalbit-ai-monitoring-api
tag: 'latest'
secrets:
USERNAME: ${{ secrets.DOCKER_HUB_USER }}
PASSWORD: ${{ secrets.DOCKER_HUB_PAT }}
ORGANIZATION: ${{ secrets.DOCKER_HUB_ORG }}
build-ui:
if: ${{ github.event.comment.body == '/build-ui' || github.event.comment.body == '/build-all' }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/docker.yaml@v1
with:
push: false
context: ./ui
image: radicalbit-ai-monitoring-ui
tag: 'latest'
secrets:
USERNAME: ${{ secrets.DOCKER_HUB_USER }}
PASSWORD: ${{ secrets.DOCKER_HUB_PAT }}
ORGANIZATION: ${{ secrets.DOCKER_HUB_ORG }}
build-spark:
if: ${{ github.event.comment.body == '/build-spark' || github.event.comment.body == '/build-all' }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/docker.yaml@v1
with:
push: false
context: ./spark
image: radicalbit-spark-py
tag: 'latest'
secrets:
USERNAME: ${{ secrets.DOCKER_HUB_USER }}
PASSWORD: ${{ secrets.DOCKER_HUB_PAT }}
ORGANIZATION: ${{ secrets.DOCKER_HUB_ORG }}
build-migrations:
if: ${{ github.event.comment.body == '/build-migrations' || github.event.comment.body == '/build-all' }}
uses: radicalbit/radicalbit-github-workflows/.github/workflows/docker.yaml@v1
with:
push: false
context: ./api
dockerfile: migrations.Dockerfile
image: radicalbit-ai-monitoring-migrations
tag: 'latest'
secrets:
USERNAME: ${{ secrets.DOCKER_HUB_USER }}
PASSWORD: ${{ secrets.DOCKER_HUB_PAT }}
ORGANIZATION: ${{ secrets.DOCKER_HUB_ORG }}
comment-job-link:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.comment.body, 'BOT:') }}
env:
GITHUB_TOKEN: ${{ secrets.GIT_HUB_PAT }}
steps:
- name: Comment on issue
if: ${{ contains(fromJson(env.AVAILABLE_COMMANDS), github.event.comment.body)}}
run: |
export JOB_LINK="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
echo -n "{\"body\":\"### BOT: Running Job\nRequested JOB status is available [here]($JOB_LINK)\"}" > result.json
curl -X POST -H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
${{ github.event.issue.comments_url }} \
-d @result.json