From 1bb516dd561ed432eef0fe534621826bce05d727 Mon Sep 17 00:00:00 2001 From: october <764213885@qq.com> Date: Sat, 28 May 2022 01:50:27 +0800 Subject: [PATCH 1/2] feat: add auto build & push docker images by github actions --- .github/workflows/docker-images.yml | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/docker-images.yml diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml new file mode 100644 index 0000000000..247cf55782 --- /dev/null +++ b/.github/workflows/docker-images.yml @@ -0,0 +1,35 @@ +name: Build Docker + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + steps: + - name: Login in Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Clone Code + uses: actions/checkout@v3 + + - name: Use Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install Package + run: npm install + + - name: Build & Push + run: node ./scripts/builder.js all -l -p From 1dad887b3c23675e506ade54a3731b20074b86e4 Mon Sep 17 00:00:00 2001 From: october <764213885@qq.com> Date: Sat, 28 May 2022 22:21:27 +0800 Subject: [PATCH 2/2] chore: update triggering method --- .github/workflows/docker-images.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 247cf55782..12db1f5fd7 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -2,9 +2,8 @@ name: Build Docker on: push: - branches: [ main ] - pull_request: - branches: [ main ] + tags: + - v* jobs: build: