-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.03 KB
/
build-and-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 }}"