Merge pull request #37 from ks6088ts-labs/feature/issue-36_support-do… #1
Workflow file for this run
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: 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: . | |
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 |