2021-04-07 05:44:11 +08:00
|
|
|
name: Publish Docker
|
|
|
|
|
2021-04-09 06:05:07 +08:00
|
|
|
on:
|
2021-04-25 21:59:41 +08:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
description: 'docker tag'
|
|
|
|
required: true
|
2023-02-24 05:11:57 +08:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
tag:
|
|
|
|
type: string
|
|
|
|
required: true
|
2021-04-25 21:59:41 +08:00
|
|
|
|
2021-04-07 05:44:11 +08:00
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2021-11-17 23:37:34 +08:00
|
|
|
name: Set tag
|
2021-04-25 21:59:41 +08:00
|
|
|
run: |
|
|
|
|
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
|
|
|
|
TAG=${{ github.event.inputs.tag }}
|
2021-12-04 05:46:39 +08:00
|
|
|
elif [[ "${{ github.ref_name }}" == 'master' ]]; then
|
2021-04-25 21:59:41 +08:00
|
|
|
TAG="latest"
|
|
|
|
else
|
2021-12-04 05:46:39 +08:00
|
|
|
TAG="${{ github.ref_name }}"
|
2021-04-25 21:59:41 +08:00
|
|
|
fi
|
|
|
|
echo "TAG=${TAG}" >> $GITHUB_ENV
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2021-11-17 23:37:34 +08:00
|
|
|
name: Checkout
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2021-11-17 23:37:34 +08:00
|
|
|
name: Set up QEMU
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2021-11-17 23:37:34 +08:00
|
|
|
name: Set up Docker Buildx
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2022-12-22 23:38:45 +08:00
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-11-18 02:55:51 +08:00
|
|
|
-
|
2022-11-10 23:52:44 +08:00
|
|
|
name: Build and push
|
|
|
|
uses: docker/build-push-action@v3
|
2021-11-18 02:55:51 +08:00
|
|
|
with:
|
|
|
|
context: .
|
2022-11-10 23:52:44 +08:00
|
|
|
platforms: linux/amd64, linux/arm64, linux/arm/v7
|
|
|
|
push: true
|
|
|
|
tags: ${{ github.repository }}:${{ env.TAG }}, ${{ github.repository }}:latest
|
2022-12-22 23:14:12 +08:00
|
|
|
build-args: |
|
|
|
|
tags=ce
|
2022-11-10 23:52:44 +08:00
|
|
|
|
|
|
|
docker-ee:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2022-11-10 23:52:44 +08:00
|
|
|
name: Set tag
|
2022-09-22 19:48:45 +08:00
|
|
|
run: |
|
2022-11-10 23:52:44 +08:00
|
|
|
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
|
2022-12-22 22:48:09 +08:00
|
|
|
TAG=${{ github.event.inputs.tag }}
|
2022-11-10 23:52:44 +08:00
|
|
|
elif [[ "${{ github.ref_name }}" == 'master' ]]; then
|
|
|
|
TAG="latest"
|
|
|
|
else
|
|
|
|
TAG="${{ github.ref_name }}"
|
|
|
|
fi
|
|
|
|
echo "TAG=${TAG}" >> $GITHUB_ENV
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2022-11-10 23:52:44 +08:00
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2022-11-10 23:52:44 +08:00
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
2022-12-01 19:27:47 +08:00
|
|
|
-
|
2022-11-10 23:52:44 +08:00
|
|
|
name: Set up Docker Buildx
|
2022-12-22 23:51:48 +08:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2022-11-10 23:52:44 +08:00
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
|
|
|
uses: docker/login-action@v2
|
2022-09-22 19:48:45 +08:00
|
|
|
with:
|
2022-11-10 23:52:44 +08:00
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
2021-11-17 23:37:34 +08:00
|
|
|
-
|
|
|
|
name: Build and push
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: docker/build-push-action@v3
|
2021-04-09 06:05:07 +08:00
|
|
|
with:
|
|
|
|
context: .
|
2022-12-01 19:27:47 +08:00
|
|
|
platforms: linux/amd64, linux/arm64
|
2021-11-05 06:35:43 +08:00
|
|
|
push: true
|
2022-11-10 23:52:44 +08:00
|
|
|
tags: ${{ github.repository }}:${{ env.TAG }}-ee
|
2022-12-22 23:14:12 +08:00
|
|
|
build-args: |
|
|
|
|
tags=ee
|