-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refaktorer resten av github workflows til å gjenbruke workflows/actions
- Loading branch information
Showing
16 changed files
with
251 additions
and
244 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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
name: 'Build and test' | ||
description: 'Checkout, download java and assemble and test' | ||
|
||
inputs: | ||
gradle-arguments: | ||
required: false | ||
description: 'Gradle arguments to pass to gradle build' | ||
default: build | ||
runs: | ||
using: "composite" | ||
steps: | ||
|
@@ -9,4 +15,4 @@ runs: | |
uses: gradle/[email protected] | ||
with: | ||
gradle-version: wrapper | ||
arguments: build | ||
arguments: ${{ inputs.gradle-arguments }} |
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- '.github/workflows/datapakker.yml' | ||
- 'datapakker/**' | ||
- 'common/**' | ||
|
||
env: | ||
IMAGE: ghcr.io/${{ github.repository }}/datapakker/soknad:${{ github.sha }} | ||
permissions: {} | ||
|
||
jobs: | ||
build: | ||
build-test-push-image: | ||
name: Build and push Docker container | ||
runs-on: ubuntu-latest | ||
permissions: | ||
|
@@ -20,62 +19,39 @@ jobs: | |
id-token: 'write' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-v2-${{ hashFiles('gradle.properties', 'settings.gradle.kts', '**/build.gradle.kts', 'gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '19' | ||
distribution: 'temurin' | ||
- name: test and build | ||
run: ./gradlew --no-build-cache :datapakker:soknad:build | ||
env: | ||
ORG_GRADLE_PROJECT_githubUser: x-access-token | ||
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
- name: Build and test | ||
uses: ./.github/actions/build-and-test | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and publish Docker image | ||
uses: docker/[email protected] | ||
gradle-arguments: :datapakker:soknad:build | ||
- name: Push image | ||
uses: ./.github/actions/push-image | ||
with: | ||
context: . | ||
file: ./datapakker/soknad/Dockerfile | ||
push: true | ||
pull: true | ||
tags: ${{env.IMAGE}} | ||
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | ||
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | ||
tag: ${{ github.sha }} | ||
dockerfile: ./datapakker/soknad/Dockerfile | ||
image_suffix: 'datapakker-job' | ||
|
||
deploy_to_dev: | ||
name: Deploy to dev | ||
needs: build | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: nais/deploy/actions/deploy@v1 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
CLUSTER: dev-fss | ||
RESOURCE: datapakker/soknad/nais.yml | ||
VARS: datapakker/soknad/nais-dev.json | ||
uses: navikt/su-se-bakover/.github/workflows/reusable-deploy.yml@master | ||
needs: build-test-push-image | ||
with: | ||
tag: ${{ github.sha }} | ||
cluster: dev-fss | ||
vars: datapakker/soknad/nais-dev.json | ||
resource: datapakker/soknad/nais.yml | ||
secrets: | ||
NAIS_DEPLOY_APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
|
||
deploy_to_prod: | ||
name: Deploy to prod | ||
needs: build | ||
if: github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: nais/deploy/actions/deploy@v1 | ||
env: | ||
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | ||
CLUSTER: prod-fss | ||
RESOURCE: datapakker/soknad/nais.yml | ||
VARS: datapakker/soknad/nais-prod.json | ||
uses: navikt/su-se-bakover/.github/workflows/reusable-deploy.yml@master | ||
needs: build-test-push-image | ||
with: | ||
tag: ${{ github.sha }} | ||
cluster: prod-fss | ||
vars: datapakker/soknad/nais-prod.json | ||
resource: datapakker/soknad/nais.yml | ||
secrets: | ||
NAIS_DEPLOY_APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,6 +3,8 @@ name: CodeQL | |
on: | ||
workflow_call: | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
draft-release: | ||
permissions: | ||
|
Oops, something went wrong.