Skip to content

bugfix: update path to Dockerfile for release action #2

bugfix: update path to Dockerfile for release action

bugfix: update path to Dockerfile for release action #2

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}}
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:${{steps.set_version.outputs.no-dash}}
${{ secrets.DOCKERHUB_USERNAME }}/azure-ai-services-solutions:latest