Skip to content

Merge pull request #2 from ks6088ts-labs/feature/issue-1_aoai #1

Merge pull request #2 from ks6088ts-labs/feature/issue-1_aoai

Merge pull request #2 from ks6088ts-labs/feature/issue-1_aoai #1

Workflow file for this run

name: ghcr
on:
push:
tags:
- "v*"
env:
IMAGE_NAME: sandbox-go
jobs:
ghcr:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- 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: Set meta data tag = ${{steps.set_version.outputs.no-dash}}
uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}},value=v${{steps.set_version.outputs.no-dash}}
type=raw,value=latest
- uses: docker/build-push-action@v6
with:
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}