Skip to content

Commit

Permalink
Merge pull request #822 from dvsa/dockerCache
Browse files Browse the repository at this point in the history
chore: mvn cach
  • Loading branch information
sr4850 authored Sep 17, 2024
2 parents dfa119d + e7a7d5f commit 3998b6d
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Maven

name: Maven
on:
workflow_call:
inputs:
Expand All @@ -8,20 +7,37 @@ on:
required: true
default: 'package'
type: string

permissions:
contents: read
packages: write

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: whelk-io/maven-settings-xml-action@v22
with:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: whelk-io/maven-settings-xml-action@v22
with:
servers: '[{ "id":"dvsa-github-packages", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } },{ "id":"github-publish", "configuration": { "httpHeaders": { "property": { "name":"Authorization", "value":"Bearer ${{ secrets.GITHUB_TOKEN }}"} } } } ]'
- run: mvn -B -P github ${{ inputs.maven-goal}}


- name: Build with Maven
run: mvn -B -P github ${{ inputs.maven-goal}} -Dmaven.repo.local=$HOME/.m2/repository

0 comments on commit 3998b6d

Please sign in to comment.