Skip to content

Commit

Permalink
Merge pull request #511 from navikt/dev
Browse files Browse the repository at this point in the history
🚀  Deploy: Oppdater versjoner
  • Loading branch information
tu55eladd authored Jan 17, 2023
2 parents 4201c19 + 9984319 commit f78a768
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 11 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/deploy-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy branch to dev
run-name: Deploy feature branch ${{ github.ref_name }} by @${{ github.actor }}
on:
workflow_dispatch:

env:
IMAGE_TAG: ${{ github.sha }}
IMAGE: ghcr.io/${{ github.repository }}/veilarboppfolging
PRINT_PAYLOAD: true

concurrency:
group: deploy_feature_branch
cancel-in-progress: true

jobs:
test-build-and-push:
name: Test, build and push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Build maven artifacts
run: mvn -B package
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.IMAGE }}:${{ env.IMAGE_TAG }}

deploy-dev:
name: Deploy application to dev
needs: test-build-and-push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Deploy application
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: nais-dev.yaml
VAR: version=${{ env.IMAGE_TAG }},namespace=q1
11 changes: 3 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ jobs:
with:
java-version: 11
distribution: 'temurin'
- name: Set up cache
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
cache: 'maven'
- name: Run maven tests
run: mvn -B verify

Expand All @@ -47,13 +42,13 @@ jobs:
- name: Build maven artifacts
run: mvn -B package
- name: Login to Docker
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
push: true
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.1</version>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -83,7 +83,7 @@
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.6.13</version>
<version>1.6.14</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -122,7 +122,7 @@
<dependency>
<groupId>net.javacrumbs.shedlock</groupId>
<artifactId>shedlock-provider-jdbc-template</artifactId>
<version>4.41.0</version>
<version>4.42.0</version>
</dependency>

<!-- Tjenestespesifikasjoner -->
Expand Down

0 comments on commit f78a768

Please sign in to comment.