Skip to content

Merge pull request #89 from zqzten/algorithm #4

Merge pull request #89 from zqzten/algorithm

Merge pull request #89 from zqzten/algorithm #4

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@v3
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@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v4
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 }}