Skip to content

Commit

Permalink
Upgrade java to 21 and bump actions (#92)
Browse files Browse the repository at this point in the history
* dummy commit

* temurin java 21

* Bump actions

* Bump more in gh actions

* Bump dockerimage to java 21 distroless

---------

Co-authored-by: sigurdgroneng <[email protected]>
  • Loading branch information
holymaloney and tu55eladd authored Feb 23, 2024
1 parent fbecf76 commit a9441c2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 37 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
- name: Build maven artifacts
run: mvn -B package
- uses: docker/login-action@v2
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
- uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/feature-branch-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set up cache
uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
java-version: 21
cache: 'maven'
- name: Build maven artifacts
run: mvn -B package
- uses: docker/login-action@v2
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
- uses: docker/build-push-action@v5
with:
context: .
push: true
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/naisdeploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Deploy application to ${{ inputs.environment }}
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.nais-deploy-secret }}
CLUSTER: ${{ inputs.environment }}-gcp
RESOURCE: .nais/nais-${{ inputs.environment }}.yaml
VAR: version=${{ github.sha }}
- name: Create release for prod
uses: softprops/action-gh-release@v1
if: inputs.environment == 'prod'
with:
name: Release to prod
tag_name: release/prod@${{ github.sha }}
prerelease: false
17 changes: 6 additions & 11 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,15 @@ jobs:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
java-version: 21
distribution: 'temurin' #version?
cache: 'maven'
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
Expand Down
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
FROM ghcr.io/navikt/poao-baseimages/java:17
FROM busybox:1.36.1-uclibc as busybox
FROM gcr.io/distroless/java21-debian12:nonroot

COPY --from=busybox /bin/sh /bin/sh
COPY --from=busybox /bin/printenv /bin/printenv

WORKDIR /app
COPY /target/aktivitet-arena-acl.jar app.jar
ENV TZ="Europe/Oslo"
EXPOSE 8080
CMD ["app.jar"]

0 comments on commit a9441c2

Please sign in to comment.