Skip to content

Commit

Permalink
Oppdater github workflow (#144)
Browse files Browse the repository at this point in the history
* Oppdater github workflow

* Legg til dependabot.yml

* Legg til dependabot.yml
  • Loading branch information
ugur93 authored Oct 2, 2023
1 parent 79dcd28 commit 2241039
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 41 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "[dependency] "
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "[docker] "
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "[github-actions] "
14 changes: 8 additions & 6 deletions .github/workflows/deploy_feature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- '**'
- '!main'
- '!dependabot/**'

env:
GITHUB_USERNAME: x-access-token
Expand All @@ -16,7 +18,7 @@ jobs:
name: Build with maven and docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
Expand All @@ -27,7 +29,7 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn -Dmaven.test.skip=true -B -e --settings .m2/maven-settings.xml clean install
- run: mvn -Dmaven.test.skip=true -B -e clean install
- uses: nais/docker-build-push@v0
id: docker-push
with:
Expand All @@ -43,26 +45,26 @@ jobs:
name: Run tests
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/cache@v3
with:
path: ~/.m2
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn -B -e --settings .m2/maven-settings.xml clean install
- run: mvn -B -e clean install

deploy-feature:
runs-on: ubuntu-latest
name: Deploy feature
needs: build

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: deploy
- name: Deploy to dev-gcp for feature.yaml
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@ name: Deploy to dev
on:
pull_request:
types: [ ready_for_review, opened, synchronize ]
push:
branches:
- 'main'

env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
if: github.event.pull_request.draft == false
permissions:
contents: "read"
id-token: "write"
name: Build with maven and docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
Expand All @@ -29,7 +27,7 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn -Dmaven.test.skip=true -B -e --settings .m2/maven-settings.xml clean install
- run: mvn -Dmaven.test.skip=true -B -e clean install
- uses: nais/docker-build-push@v0
id: docker-push
with:
Expand All @@ -45,25 +43,26 @@ jobs:
name: Run tests
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/cache@v3
with:
path: ~/.m2
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn -B -e --settings .m2/maven-settings.xml clean install
- run: mvn -B -e clean install

deploy-main:
if: github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
name: Deploy main
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: deploy
- name: Deploy main branch to dev-gcp
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Build with maven and docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: '17'
Expand All @@ -26,7 +26,7 @@ jobs:
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- run: mvn -Dmaven.test.skip=true -B -e --settings .m2/maven-settings.xml clean install
- run: mvn -Dmaven.test.skip=true -B -e clean install
- uses: nais/docker-build-push@v0
id: docker-push
with:
Expand All @@ -43,7 +43,7 @@ jobs:
needs: build

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: deploy
- uses: nais/deploy/actions/deploy@v1
Expand All @@ -64,7 +64,7 @@ jobs:
contents: write
needs: deploy
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Push latest image tag as github tag
id: tag_version
uses: mathieudutour/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rollback_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
name: Find tag to deploy

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: NAIS login
uses: nais/login@v0
id: login
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
needs: prepare_deploy

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
Expand Down
14 changes: 0 additions & 14 deletions .m2/maven-settings.xml

This file was deleted.

1 change: 0 additions & 1 deletion .nais/feature.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: bidrag-stonad-feature
ingresses:
- https://bidrag-stonad-feature.intern.dev.nav.no
- https://bidrag-stonad-feature.dev.intern.nav.no
dbname: bidrag-stonad-feature
kafka:
pool: nav-dev
Expand Down
1 change: 0 additions & 1 deletion .nais/main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: bidrag-stonad
ingresses:
- https://bidrag-stonad.intern.dev.nav.no
- https://bidrag-stonad.dev.intern.nav.no
dbname: bidrag-stonad-main
kafka:
pool: nav-dev
Expand Down
4 changes: 0 additions & 4 deletions .nais/nais.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ spec:
requests:
cpu: 500m
memory: 1024Mi
replicas:
cpuThresholdPercentage: 80
max: 4
min: {{ spec.replicas.min }}
ingresses:
{{#each ingresses as |url|}}
- {{url}}
Expand Down

0 comments on commit 2241039

Please sign in to comment.