From 31d177ca4bb548d67bc60ef78b8e3816e4cf026f Mon Sep 17 00:00:00 2001 From: xpnas Date: Wed, 12 May 2021 19:33:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0dev=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docker_dev.yml | 59 ++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/docker_dev.yml diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml new file mode 100644 index 0000000..e84f4a7 --- /dev/null +++ b/.github/workflows/docker_dev.yml @@ -0,0 +1,59 @@ +name: docker + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - + name: Check out the repo + uses: actions/checkout@v2 + + - 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 }}:dev + + - name: 'Report Suecss' + run: curl ${{ secrets.INOTIFY }}/Inotify/DevIsOk!