From c0727277c1084da4a08fe62e877adc60583da621 Mon Sep 17 00:00:00 2001 From: xpnas Date: Sat, 27 Mar 2021 01:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker_release.yml | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/docker_release.yml diff --git a/.github/workflows/docker_release.yml b/.github/workflows/docker_release.yml new file mode 100644 index 0000000..9d43ee9 --- /dev/null +++ b/.github/workflows/docker_release.yml @@ -0,0 +1,61 @@ +name: docker_release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Check out the repo + uses: actions/checkout@v2 + + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Cache node modules NPM + uses: actions/cache@v2 + env: + cache-name: cache-node-modules-NPM + with: + path: ~/.npm + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }} + + - name: Cache node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ./Inotify.Vue/node_modules + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }} + restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./Inotify.Vue/package.json') }} + + - name: InstallNode and BuildVue + run: | + cd ./Inotify.Vue + npm install + npm run build:prod + + - + name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - + name: Docker Build & Push to Docker Hub For Service + uses: docker/build-push-action@v2 + with: + context: . + file: ./Inotify/Dockerfile + platforms: linux/amd64 + push: true + tags: ${{ secrets.DOCKERHUB_TAG }}:latest + + - name: 'Report Suecss' + run: curl ${{ secrets.INOTIFY }}/Inotify/dockerBuildComplated!