-
Notifications
You must be signed in to change notification settings - Fork 7
63 lines (54 loc) · 1.73 KB
/
gradle.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
57
58
59
60
61
62
63
name: Build and Package
on: [push, pull_request]
env:
GO_REPO: gameontext/gameon-auth
SUBMODULE: auth
JAVA_VERSION: 11
JAVA_DISTRO: temurin
jobs:
build:
runs-on: ubuntu-latest
outputs:
submodule: ${{ env.SUBMODULE }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
cache: gradle
- name: Build with Gradle
id: gradle-build
run: ./gradlew build
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.GO_REPO }}
tags: |
type=schedule,pattern={{date 'YYYYMMDD'}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,enable=true,priority=200,prefix=,suffix=,value=gh-${{ github.ref_name }}-${{ github.run_number }}
- name: Login to Docker Hub
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
if: github.repository == ${{ env.GO_REPO }}
uses: docker/build-push-action@v3
with:
context: ./auth-wlpcfg
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
call-submodule-update:
needs: build
uses: gameontext/gameon/.github/workflows/updateSubmodule.yml@main
with:
submodule: ${{ needs.build.outputs.submodule }}
submodule_ref: ${{ github.sha }}
target_branch: ${{ github.ref_name }}
secrets: inherit