From df905ade88cdcfb93e45e1748c98b6be1b24411d Mon Sep 17 00:00:00 2001 From: yoan <536464346@qq.com> Date: Sun, 24 Nov 2024 20:01:04 +0800 Subject: [PATCH] workflow ajustment --- .github/workflows/push_image.yml | 2 +- .github/workflows/push_image_next.yml | 62 +++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/push_image_next.yml diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index dbcc776c..7d2d08a6 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -3,7 +3,7 @@ name: Docker Image CI on: push: tags: - - "*" + - "*-beta" workflow_dispatch: inputs: tag: diff --git a/.github/workflows/push_image_next.yml b/.github/workflows/push_image_next.yml new file mode 100644 index 00000000..7052bab2 --- /dev/null +++ b/.github/workflows/push_image_next.yml @@ -0,0 +1,62 @@ +name: Docker Image CI + +on: + push: + tags: + - "*-alpha*" + workflow_dispatch: + inputs: + tag: + description: "Tag version to be used for Docker image" + required: true + default: "v0.1.9" + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + 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: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + usual2970/certimate + registry.cn-shanghai.aliyuncs.com/usual2970/certimate + tags: | + type=ref,event=tag + type=raw,value=latest,enable={{is_default_branch}} + + - name: Log in to DOCKERHUB + uses: docker/login-action@v3 + + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Log in to ALIYUNCS + uses: docker/login-action@v3 + + with: + registry: registry.cn-shanghai.aliyuncs.com + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} +