From b60d5babe50175d2a80ad697b3ac547a6fc9388e Mon Sep 17 00:00:00 2001 From: vran Date: Sat, 5 Mar 2022 22:40:28 +0800 Subject: [PATCH] feat: add docker build action --- .github/workflows/release.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2699d36..4e44966 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,13 +21,13 @@ jobs: server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file - - name: add permission to gradle + - name: Gradle Permission Grant run: chmod +x ./gradlew - - name: build with gradle + - name: Gradle Build run: ./gradlew api:build -x checkstyleMain -x checkstyleTest - - name: release jar + - name: Application Jar Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: @@ -37,3 +37,19 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Docker Image Release + uses: docker/build-push-action@v2 + with: + context: . + file: ./local.Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/databasir:latest \ No newline at end of file