Skip to content

feat: Use an image hosted in AliCloud ACR as the base image #10

feat: Use an image hosted in AliCloud ACR as the base image

feat: Use an image hosted in AliCloud ACR as the base image #10

name: Build Plugin Server Image and Push
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-plugin-server-image:
runs-on: ubuntu-latest
environment:
name: image-registry-plugin-server
env:
PLUGIN_SERVER_IMAGE_REGISTRY: ${{ vars.IMAGE_REGISTRY || 'higress-registry.cn-hangzhou.cr.aliyuncs.com' }}
PLUGIN_SERVER_IMAGE_NAME: ${{ vars.PLUGIN_SERVER_IMAGE_NAME || 'higress/plugin-server' }}
steps:
- name: "Checkout ${{ github.ref }}"
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Free Up GitHub Actions Ubuntu Runner Disk Space 🔧
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Calculate Docker metadata
id: docker-meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.PLUGIN_SERVER_IMAGE_REGISTRY }}/${{ env.PLUGIN_SERVER_IMAGE_NAME }}
tags: |
type=raw,value=1.0.0
- name: Set up Docker Buildx (with docker-container driver)
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
install: true
use: true
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ env.PLUGIN_SERVER_IMAGE_REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build Docker Image and Push
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t ${{ steps.docker-meta.outputs.tags }} \
-f Dockerfile \
--push \
.