feat: add docker build action

This commit is contained in:
vran 2022-03-05 22:40:28 +08:00
parent 3d128f91c5
commit b60d5babe5
1 changed files with 19 additions and 3 deletions

View File

@ -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