Merge pull request #126 from ptkis/dependabot/gradle/io.github.microu… #109
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Publish and Deploy with Docker | |
on: | |
push: | |
branches: [ main, master ] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.actor }} | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 120 | |
permissions: | |
checks: write | |
contents: read | |
issues: read | |
pull-requests: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Install docker | |
run: | | |
command docker -v || curl -fsSL get.docker.com | sudo bash | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Assemble with Gradle | |
run: ./gradlew assemble | |
- name: Build docker | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: Dockerfile | |
platforms: linux/amd64 | |
push: true | |
build-args: | | |
VERSION=0.0.${{ github.run_number }} | |
ARTIFACT=banyuwangi-core | |
tags: | | |
ghcr.io/${{ github.repository }}:latest | |
ghcr.io/${{ github.repository }}:0.0.${{ github.run_number }} |