Skip to content

Merge pull request #95 from zqzten/ci #5

Merge pull request #95 from zqzten/ci

Merge pull request #95 from zqzten/ci #5

name: Release Algorithm
on:
push:
tags:
- 'algorithm-v*'
permissions:
contents: read
packages: write
jobs:
build-and-push-image:
name: Build and push image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get tag
run: echo "tag=$(git describe --tags --match 'algorithm-v*' | sed -e 's/^algorithm-//')" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: ./algorithm
file: ./algorithm/horizontal-predictive.Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/${{ github.repository_owner }}/kapacity-algorithm-horizontal-predictive:${{ env.tag }}