diff --git a/.github/workflows/check.yml b/.github/workflows/auto-checkstyle.yml similarity index 100% rename from .github/workflows/check.yml rename to .github/workflows/auto-checkstyle.yml diff --git a/.github/workflows/auto-docker-latest.yml b/.github/workflows/auto-docker-latest.yml new file mode 100644 index 0000000..211db01 --- /dev/null +++ b/.github/workflows/auto-docker-latest.yml @@ -0,0 +1,45 @@ +# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java#publishing-using-gradle + +name: docker image latest push + +on: + push: + branches: + - 'master' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: '11' + 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: Gradle Permission Grant + run: chmod +x ./gradlew + + - name: Gradle Build + run: ./gradlew api:build -x checkstyleMain -x checkstyleTest + + - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/manual-release.yml similarity index 81% rename from .github/workflows/release.yml rename to .github/workflows/manual-release.yml index 4e44966..c6e6a17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/manual-release.yml @@ -1,12 +1,11 @@ -# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created -# For more information see: https://github.com/actions/setup-java#publishing-using-gradle - name: release on: - push: - tags: - - 'v*' + workflow_dispatch: + inputs: + tag: + required: true + description: 'release tag version' jobs: release: @@ -31,6 +30,7 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: + tag_name: ${{ github.event.inputs.tag }} files: api/build/libs/databasir.jar draft: true fail_on_unmatched_files: true @@ -52,4 +52,4 @@ jobs: context: . file: ./local.Dockerfile push: true - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/databasir:latest \ No newline at end of file + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/databasir:${{ github.event.inputs.tag }} \ No newline at end of file