-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.43 KB
/
build-deploy-lib.yml
File metadata and controls
53 lines (45 loc) · 1.43 KB
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
on:
push:
branches:
- master
paths-ignore:
- "**/*.md"
- "Makefile"
- ".mvn"
- ".gitignore"
env:
DAPLA_REGISTRY: europe-north1-docker.pkg.dev/${{secrets.GAR_PROJECT_ID}}/dftjen-maven
jobs:
build-push:
name: Build and push to registries
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: maven
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: "projects/${{secrets.GAR_PROJECT_NUMBER}}/locations/global/workloadIdentityPools/gh-actions/providers/gh-actions"
service_account: "gh-actions-dftjen@${{secrets.GAR_PROJECT_ID}}.iam.gserviceaccount.com"
token_format: access_token
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Artifact Registry
uses: docker/login-action@v3
with:
registry: ${{ env.DAPLA_REGISTRY }}
username: "oauth2accesstoken"
password: "${{ steps.auth.outputs.access_token }}"
- name: Maven build and deploy
run: |
mvn --batch-mode -P dapla-artifact-registry,github deploy