Use docker actions to build image instead of Makefile

This commit is contained in:
motoki317 2023-04-15 21:54:44 +09:00
parent 16c6c0ee13
commit 29fd252c66
No known key found for this signature in database
GPG key ID: EEFEAE0FAA3D3FC9

View file

@ -5,15 +5,51 @@ on:
tags: tags:
- "v*" - "v*"
env:
REGISTRY_NAME: cr.yandex/crp9ftr22d26age3hulg
REGISTRY_NAME2: cr.il.nebius.cloud/crll7us9n6i5j3v4n92m
IMAGE_NAME: csi-s3
IMAGE_NAME2: yandex-cloud/csi-s3/csi-s3-driver
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set IMAGE_TAG env
# GITHUB_REF value: refs/heads/v*
run: echo "VERSION=$(echo ${GITHUB_REF:11})" >> $GITHUB_ENV
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Push Docker - name: Set up QEMU
run: (echo '${{ secrets.REGISTRY_KEY }}' | docker login --username json_key --password-stdin cr.yandex) && make push uses: docker/setup-qemu-action@v2
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Show available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: cr.yandex
username: json_key
password: ${{ secrets.REGISTRY_KEY }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}
${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME2 }}:${{ env.VERSION }}
${{ env.REGISTRY_NAME }}/${{ env.IMAGE_NAME2 }}:latest
- uses: "marvinpinto/action-automatic-releases@latest" - uses: "marvinpinto/action-automatic-releases@latest"
with: with: