Skip to content

Commit

Permalink
Simplify maven build cache and fix repository configuration for Artif…
Browse files Browse the repository at this point in the history
…act Registry. (#28)
  • Loading branch information
bjornandre authored Nov 14, 2023
1 parent f401ef5 commit 01d5980
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
with:
java-version: 21
distribution: zulu
cache: maven

- name: Authenticate to Google Cloud
id: auth
Expand All @@ -32,13 +33,6 @@ jobs:
service_account: "gh-actions-dapla-pseudo@artifact-registry-5n.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: mvn --batch-mode -P ssb-bip deploy

27 changes: 9 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,24 @@

<repositories>
<repository>
<id>artifact-registry</id>
<url>${artifact-registry.url}</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>artifact-registry-snapshot</id>
<id>jcenter.bintray.com</id>
<url>https://jcenter.bintray.com</url>
</repository>
<repository>
<id>artifact-registry</id>
<url>${artifact-registry.url}</url>
<releases>
<enabled>false</enabled>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>jcenter.bintray.com</id>
<url>https://jcenter.bintray.com</url>
</repository>
</repositories>

<dependencyManagement>
Expand Down

0 comments on commit 01d5980

Please sign in to comment.