-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.61 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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 }}