From 9aac42d41489caaff94d7937f080d70df4fb77c4 Mon Sep 17 00:00:00 2001 From: LamGC Date: Thu, 18 Aug 2022 14:48:50 +0800 Subject: [PATCH] =?UTF-8?q?ci(github-action):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E6=AE=B5=E5=AE=B9=E5=99=A8=E6=9E=84=E5=BB=BA=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E9=85=8D=E7=BD=AE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 试一下看看能不能生成容器, 如果可以的话就整合到发布工作流中. --- .../workflows/build-container-image-dev.yml | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/build-container-image-dev.yml diff --git a/.github/workflows/build-container-image-dev.yml b/.github/workflows/build-container-image-dev.yml new file mode 100644 index 0000000..ac7ed75 --- /dev/null +++ b/.github/workflows/build-container-image-dev.yml @@ -0,0 +1,49 @@ +name: Build and test project + +on: + push: + branches: + - "main" + - "add-docker-image" + +permissions: + contents: read + +jobs: + build: + timeout-minutes: 8 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt-hotspot' + cache: 'gradle' + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build project and install Distribution package + uses: gradle/gradle-build-action@v2.2.1 + with: + gradle-version: 'wrapper' + arguments: installDist + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push container image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: scalabot:dev + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file