Skip to content

Merge pull request #68 from ks6088ts-labs/feature/issue-67_support-bi… #5

Merge pull request #68 from ks6088ts-labs/feature/issue-67_support-bi…

Merge pull request #68 from ks6088ts-labs/feature/issue-67_support-bi… #5

Workflow file for this run

name: docker-release
on:
push:
tags:
- "v*"
jobs:
release:
runs-on: "ubuntu-latest"
timeout-minutes: 5
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# https://github.com/docker/build-push-action/issues/42#issuecomment-915323168
- name: Set Versions
uses: actions/github-script@v7
id: set_version
with:
script: |
const tag = context.ref.substring(10)
const no_v = tag.replace('v', '')
const dash_index = no_v.lastIndexOf('-')
const no_dash = (dash_index > -1) ? no_v.substring(0, dash_index) : no_v
core.setOutput('tag', tag)
core.setOutput('no-v', no_v)
core.setOutput('no-dash', no_dash)
- name: Build and push tag ${{steps.set_version.outputs.no-dash}} for backend
uses: docker/build-push-action@v5
with:
context: .
file: ./dockerfiles/backend.Dockerfile
push: true
build-args: |
GIT_REVISION=${{ github.sha }}
GIT_TAG=${{steps.set_version.outputs.no-dash}}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/azure-ai-services-solutions:backend-${{steps.set_version.outputs.no-dash}}
${{ secrets.DOCKERHUB_USERNAME }}/azure-ai-services-solutions:backend-latest
- name: Build and push tag ${{steps.set_version.outputs.no-dash}} for frontend
uses: docker/build-push-action@v5
with:
context: .
file: ./dockerfiles/frontend.Dockerfile
push: true
build-args: |
GIT_REVISION=${{ github.sha }}
GIT_TAG=${{steps.set_version.outputs.no-dash}}
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/azure-ai-services-solutions:frontend-${{steps.set_version.outputs.no-dash}}
${{ secrets.DOCKERHUB_USERNAME }}/azure-ai-services-solutions:frontend-latest