Skip to content

fix: for version 3.0.10 #75

fix: for version 3.0.10

fix: for version 3.0.10 #75

name: Build and Publish Docker Images Demo
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
permissions:
contents: read
packages: write
jobs:
build:
runs-on: ubuntu-latest
environment: production
strategy:
fail-fast: false
matrix:
service:
- { name: "xpert-api", context: ".deploy/api", image_name: "xpert-api-demo" }
- { name: "xpert-webapp", context: ".deploy/webapp", image_name: "xpert-webapp-demo" }
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.service.context }}/Dockerfile
load: true
platforms: linux/amd64
tags: |
metadc/${{ matrix.service.image_name }}:latest
ghcr.io/xpert-ai/${{ matrix.service.image_name }}:latest
registry.cn-hangzhou.aliyuncs.com/metad/${{ matrix.service.image_name }}:latest
cache-from: type=registry,ref=metadc/${{ matrix.service.image_name }}:latest
cache-to: type=inline
- name: Docker images list
run: |
sudo docker image list
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub Registry
run: |
docker push metadc/${{ matrix.service.image_name }}:latest
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GitHub Container Registry
run: |
docker push ghcr.io/xpert-ai/${{ matrix.service.image_name }}:latest
- name: Login to Aliyun arc
uses: aliyun/acr-login@v1
with:
login-server: https://registry.cn-hangzhou.aliyuncs.com
username: "${{ secrets.ACR_USERNAME }}"
password: "${{ secrets.ACR_PASSWORD }}"
- name: Push to Aliyun arc
run: |
docker push registry.cn-hangzhou.aliyuncs.com/metad/${{ matrix.service.image_name }}:latest
# xpert-api:
# runs-on: ubuntu-latest
# environment: production
# steps:
# - uses: actions/checkout@v4
# - name: Build
# uses: docker/build-push-action@v6.3.0
# with:
# context: .
# file: ./.deploy/api/Dockerfile
# load: true
# platforms: linux/amd64
# tags: |
# ghcr.io/xpert-ai/xpert-api-demo:latest
# metadc/xpert-api-demo:latest
# registry.cn-hangzhou.aliyuncs.com/metad/xpert-api-demo:latest
# cache-from: type=registry,ref=metadc/xpert-api-demo:latest
# cache-to: type=inline
# - name: Docker images list
# run: |
# sudo docker image list
# - name: Login to DockerHub
# uses: docker/login-action@v3.2.0
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Push to Docker Hub Registry
# run: |
# docker push metadc/xpert-api-demo:latest
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3.2.0
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Push to Github Registry
# run: |
# docker push ghcr.io/xpert-ai/xpert-api-demo:latest
# - uses: aliyun/acr-login@v1
# with:
# login-server: https://registry.cn-hangzhou.aliyuncs.com
# username: "${{ secrets.ACR_USERNAME }}"
# password: "${{ secrets.ACR_PASSWORD }}"
# - name: Push to Aliyun Registry
# run: |
# docker push registry.cn-hangzhou.aliyuncs.com/metad/xpert-api-demo:latest
# xpert-webapp:
# runs-on: ubuntu-latest
# environment: production
# steps:
# - uses: actions/checkout@v4
# - name: Build
# uses: docker/build-push-action@v6.3.0
# with:
# context: .
# file: ./.deploy/webapp/Dockerfile
# load: true
# platforms: linux/amd64
# tags: |
# ghcr.io/xpert-ai/xpert-webapp-demo:latest
# metadc/xpert-webapp-demo:latest
# registry.cn-hangzhou.aliyuncs.com/metad/xpert-webapp-demo:latest
# cache-from: type=registry,ref=metadc/xpert-webapp-demo:latest
# cache-to: type=inline
# - name: Docker images list
# run: |
# sudo docker image list
# - name: Login to DockerHub
# uses: docker/login-action@v3.2.0
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Push to Docker Hub Registry
# run: |
# docker push metadc/xpert-webapp-demo:latest
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3.2.0
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Push to Github Registry
# run: |
# docker push ghcr.io/xpert-ai/xpert-webapp-demo:latest
# - uses: aliyun/acr-login@v1
# with:
# login-server: https://registry.cn-hangzhou.aliyuncs.com
# username: "${{ secrets.ACR_USERNAME }}"
# password: "${{ secrets.ACR_PASSWORD }}"
# - name: Push to Aliyun Registry
# run: |
# docker push registry.cn-hangzhou.aliyuncs.com/metad/xpert-webapp-demo:latest