From 671730a7593ab64053cbb793854373a22425b311 Mon Sep 17 00:00:00 2001 From: sdutwsl Date: Tue, 12 Dec 2023 20:27:26 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=95=9C=E5=83=8F=E4=B8=8A=E4=BC=A0QCloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-publish.yml | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..d7b6914 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,37 @@ +name: Publish Docker image + +on: + workflow_dispatch: + push: + tags: + - "v*.*" + +jobs: + push_to_registry: + name: Push Docker image to Tencent Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to Tencent Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + registry: ccr.ccs.tencentyun.com + username: ${{ secrets.QCLOUD_TCR_USERNAME }} + password: ${{ secrets.QCLOUD_TCR_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ccr.ccs.tencentyun.com/algoux/rankland-be + + - name: Build and push Docker image + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: . + file: ./Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}