-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Internal ref: [DPSKY-173] Same as for ssb-datadoc-model
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Build Java | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "generated/java/**" | ||
- ".github/workflows/build-java.yml" | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- "generated/java/**" | ||
- ".github/workflows/build-java.yml" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 21 | ||
distribution: zulu | ||
|
||
- name: Authenticate to Google Cloud | ||
id: auth | ||
uses: google-github-actions/[email protected] | ||
with: | ||
workload_identity_provider: "projects/${{ secrets.GAR_PROJECT_NUMBER }}/locations/global/workloadIdentityPools/gh-actions/providers/gh-actions" | ||
service_account: "gh-actions-dapla-stat@${{ secrets.GAR_PROJECT_ID }}.iam.gserviceaccount.com" | ||
token_format: access_token | ||
|
||
- name: Cache Maven packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Build with Maven and deploy to Artifact Registry | ||
run: | | ||
pushd generated/java/dapla-kuben-resource-model | ||
./mvnw --batch-mode -P ssb deploy | ||