Skip to content

Commit

Permalink
Remove not needed repos and try different build cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
meier-rene committed Oct 30, 2024
1 parent 06f3fd4 commit 42864ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
Expand All @@ -37,12 +38,25 @@ jobs:
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
# set dev tag for dev branch
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/dev'}}
-
name: Go Build Cache for Docker
uses: actions/cache@v4
with:
path: maven-cache
key: ${{ runner.os }}-maven-cache-${{ hashFiles('**/pom.xml') }}

- name: inject go-build-cache into docker
uses: reproducible-containers/[email protected]
with:
cache-map: maven-cache

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ipbhalle/metfragweb:buildcache
cache-to: type=registry,ref=ipbhalle/metfragweb:buildcache,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
# cache-from: type=registry,ref=ipbhalle/metfragweb:buildcache
# cache-to: type=registry,ref=ipbhalle/metfragweb:buildcache,mode=max
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN printf '# local database file folder \n\
LocalDatabasesFolderForWeb = /vol/file_databases' > /MetFragRelaunched/MetFragWeb/src/main/webapp/resources/settings.properties

# Cache Maven dependencies using a named cache
RUN --mount=type=cache,target=/root/.m2,source=maven_cache mvn -f MetFragRelaunched clean package -pl MetFragWeb -am -DskipTests
RUN --mount=type=cache,target=/root/.m2 mvn -f MetFragRelaunched clean package -pl MetFragWeb -am -DskipTests

FROM alpine:latest AS downloader

Expand Down
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -219,18 +219,6 @@
</build>

<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>msbi</id>
<url>https://msbi.ipb-halle.de/~cruttkie/maven2</url>
</repository>
<repository>
<id>nexus-ebi-release-repo</id>
<url>https://www.ebi.ac.uk/Tools/maven/repos/content/groups/ebi-repo</url>
Expand Down

0 comments on commit 42864ad

Please sign in to comment.