From 7cbc1287ddc7ff2adcf2aee4f4ec6688ba762302 Mon Sep 17 00:00:00 2001 From: Wizerd Date: Thu, 4 Jan 2024 15:21:44 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E6=94=AF=E6=8C=81arm=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker-deploy.yml | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/docker-deploy.yml diff --git a/.github/workflows/docker-deploy.yml b/.github/workflows/docker-deploy.yml new file mode 100644 index 0000000..b45986d --- /dev/null +++ b/.github/workflows/docker-deploy.yml @@ -0,0 +1,34 @@ +name: Docker Release + +on: + release: + types: [created] + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Extract tag name + id: tag_name + run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}" + + - name: Build and push Docker image with Release tag + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: | + yourusername/yourrepo:${{ steps.tag_name.outputs.tag }} + yourusername/yourrepo:latest