From 5caa0798410e9815aeb785b86b32f35f2cbf2295 Mon Sep 17 00:00:00 2001 From: jack Date: Thu, 21 Sep 2023 06:38:38 +0700 Subject: [PATCH] ci: add dockerize action --- .github/workflows/dockerize.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/dockerize.yml diff --git a/.github/workflows/dockerize.yml b/.github/workflows/dockerize.yml new file mode 100644 index 0000000..4bcb34e --- /dev/null +++ b/.github/workflows/dockerize.yml @@ -0,0 +1,30 @@ +name: dockerize + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Generate Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: 'docker.io/huanttok/dynamic-thumbnail-service-v2' + tags: | + type=semver,pattern={{major}}.{{minor}}.{{patch}} + flavor: | + latest=true + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: ${{ steps.meta.outputs.tags }} \ No newline at end of file