-
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.
Merge pull request #785 from dvsa/mavenCache
feat: maven cache
- Loading branch information
Showing
3 changed files
with
54 additions
and
38 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 |
---|---|---|
|
@@ -33,7 +33,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: hadolint/[email protected] | ||
with: | ||
dockerfile: ${{ env.WORKING_DIR }}/Dockerfile | ||
|
@@ -44,31 +43,30 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Cache Maven Dependencies | ||
uses : actions/cache@v3 | ||
- name: Download JAR artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-maven${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
name: test-jar | ||
|
||
- uses: whelk-io/maven-settings-xml-action@v22 | ||
name: generate settings xml | ||
name: Generate settings.xml | ||
with: | ||
servers: ${{ inputs.push && env.BATCH_SETTINGS || env.RUNNER_SETTINGS }} | ||
proxies: '[{ "id":"dvsa-ci-proxy", "active": "true", "protocol": "http", "host": "${{vars.CI_PROXY}}", "port": "${{vars.CI_PROXYPORT}}" }]' | ||
repositories: '[ { "id":"dvsa-github-packages", "name":"dvsa-github-packages", "url":"https://maven.pkg.github.com/dvsa/*", "releases": { "enabled": "true" }, "snapshots": { "enabled": "true" } }]' | ||
output_file: ./settings.xml | ||
- name: view settings.xml | ||
|
||
- name: View settings.xml | ||
run: cat ./settings.xml | ||
|
||
- name: Copy settings.xml | ||
run: cp ./settings.xml $GITHUB_WORKSPACE/$WORKING_DIR | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
|
||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
|
@@ -104,20 +102,20 @@ jobs: | |
if: ${{ inputs.push }} | ||
run: | | ||
aws ecr batch-delete-image --repository-name vol-qa/vft --image-ids imageTag=latest | ||
- name: Build ${{ inputs.push && 'and push ' || '' }}Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
context: . | ||
file: infra/docker/batch/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: ${{ inputs.push }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
|
||
- name: Setup Notation CLI | ||
if: ${{ inputs.push }} | ||
|
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
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