Build Docker Images and Push to Image Registry #4
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: Build Docker Images and Push to Image Registry | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version' | |
required: false | |
default: 'latest' | |
type: string | |
jobs: | |
build_and_push: | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Docker login | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.IMAGE_REGISTRY }} | |
username: ${{ secrets.REGISTRY_USERNAME }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build Docker image with Makefile | |
run: | | |
make image-buildx VERSION=${{ github.event.inputs.version }} REGISTRY=${{ env.IMAGE_REGISTRY }} | |
- name: Notify success | |
run: echo "Docker image built and pushed successfully for version ${{ github.event.inputs.version }}" |