Skip to content

Commit

Permalink
Merge branch 'main' into pw-psb
Browse files Browse the repository at this point in the history
  • Loading branch information
frodehansen2 committed Dec 12, 2023
2 parents 0701568 + 34298f8 commit f83de9e
Show file tree
Hide file tree
Showing 403 changed files with 35,259 additions and 26,181 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/.deploy-app-to-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
app-name:
type: string
required: true
is-next-app:
type: boolean
required: false

jobs:
deploy-to-dev:
Expand All @@ -20,17 +23,34 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .yarnrc.yml
run: |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies (yarn)
run: yarn
run: yarn install
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- name: Copy .env.dev for next.js build
if: ${{ inputs.is-next-app == true }}
shell: bash
run: |
echo "Copying .env.dev to app root"
cp apps/${{inputs.app-name}}/nais/envs/.env.dev apps/${{inputs.app-name}}/.env.production
- name: Build application
run: yarn build-${{ inputs.app-name }}
run: yarn turbo run build-app --filter=@navikt/${{ inputs.app-name }}

- name: Build and publish docker image
uses: nais/docker-build-push@v0
Expand All @@ -54,3 +74,4 @@ jobs:
VAR: GITHUB_REF_NAME=${{ github.ref_name }} # brukes i applikasjonerna
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
IMAGE: ${{ steps.docker-push.outputs.image }}
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
20 changes: 19 additions & 1 deletion .github/workflows/.deploy-app-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
app-name:
type: string
required: true
is-next-app:
type: boolean
required: false

jobs:
deploy-to-prod:
Expand All @@ -22,6 +25,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup .yarnrc.yml
run: |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NODE_AUTH_TOKEN
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
Expand All @@ -31,8 +42,15 @@ jobs:
- name: Install dependencies (yarn)
run: yarn

- name: Copy .env.prod for next.js build
if: ${{ inputs.is-next-app == true }}
shell: bash
run: |
echo "Copying .env.prod to app root"
cp apps/${{inputs.app-name}}/nais/envs/.env.prod apps/${{inputs.app-name}}/.env.production
- name: Build application
run: yarn build-${{ inputs.app-name }}
run: yarn turbo run build-app --filter=@navikt/${{ inputs.app-name }}

- name: Build and publish docker image
uses: nais/docker-build-push@v0
Expand Down
53 changes: 0 additions & 53 deletions .github/workflows/.test-deploy-omssoknad-distroless.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/dispatch.deploy-dine-pleiepenger-to-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy dine-pleiepenger to prod
run-name: Deploy dine-pleiepenger to prod

on:
push:
branches:
- main
paths:
- 'apps/dine-pleiepenger/**/*'
workflow_dispatch:

jobs:
run-tests:
uses: ./.github/workflows/test.dine-pleiepenger.yml
secrets: inherit

deploy-to-prod:
name: Deploy dine-pleiepenger to prod
needs: [run-tests]
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
security-events: write
id-token: write
actions: read
with:
app-name: 'dine-pleiepenger'
working-directory: 'apps/dine-pleiepenger'
is-next-app: true
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/test.ekstra-omsorgsdager-andre-forelder-ikke-tilsyn.yml
secrets: inherit

deploy-to-prod:
name: Deploy ekstra-omsorgsdager-andre-forelder-ikke-tilsyn to prod
needs: [run-tests]
uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/test.endringsmelding-pleiepenger.yml
secrets: inherit

deploy-to-prod:
name: Deploy endringsmelding-pleiepenger to prod
needs: [run-tests]
uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dispatch.deploy-ettersending-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/test.sif-ettersending.yml
secrets: inherit

deploy-to-prod:
name: Deploy sif-ettersending to prod
needs: [run-tests]
uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/test.omsorgsdager-aleneomsorg-dialog.yml
secrets: inherit

deploy-to-prod:
name: Deploy omsorgsdager-aleneomsorg-dialog to prod
needs: [run-tests]
uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy omsorgsdager kalkulator to prod
run-name: Deploy omsorgsdager kalkulator to prod

on:
push:
branches:
- main
paths:
- 'apps/omsorgsdager-kalkulator/**/*'
workflow_dispatch:

jobs:
run-tests:
uses: ./.github/workflows/test.omsorgsdager-kalkulator.yml
secrets: inherit

deploy-to-prod:
name: Deploy omsorgsdager kalkulator to prod
needs: [run-tests]
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
security-events: write
id-token: write
actions: read
with:
app-name: 'omsorgsdager-kalkulator'
working-directory: 'apps/omsorgsdager-kalkulator'
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/test.omsorgspengerutbetaling-soknad.yml
secrets: inherit

deploy-to-prod:
name: Deploy omsorgspengerutbetaling-soknad to prod
needs: [run-tests]
uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/test.omsorgspengesøknad.yml
secrets: inherit

deploy-to-prod:
name: Deploy omsorgspengesøknad to prod
needs: [run-tests]
uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ on:
jobs:
run-tests:
uses: ./.github/workflows/test.pleiepenger-i-livets-sluttfase-soknad.yml
secrets: inherit

# deploy-to-prod:
# name: Deploy pleiepenger-i-livets-sluttfase-soknad to prod
# needs: [run-tests]
# uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
# secrets: inherit
# permissions:
# contents: write
# security-events: write
# id-token: write
# actions: read
# with:
# app-name: 'pleiepenger-i-livets-sluttfase-soknad'
# working-directory: 'apps/pleiepenger-i-livets-sluttfase-soknad'
deploy-to-prod:
name: Deploy pleiepenger-i-livets-sluttfase-soknad to prod
needs: [run-tests]
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
security-events: write
id-token: write
actions: read
with:
app-name: 'pleiepenger-i-livets-sluttfase-soknad'
working-directory: 'apps/pleiepenger-i-livets-sluttfase-soknad'
67 changes: 17 additions & 50 deletions .github/workflows/dispatch.deploy-pleiepenger-sykt-barn-to-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,53 +10,20 @@ on:
workflow_dispatch:

jobs:
run-tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'

- name: Install dependencies (yarn)
run: yarn

- name: Run code tests
run: yarn test --filter=pleiepenger-sykt-barn

- name: Build and start e2e server
uses: cypress-io/[email protected]
env:
DEKORATOR_URL: https://www.nav.no/dekoratoren/?simple=true&chatbot=false
PUBLIC_PATH: /familie/sykdom-i-familien/soknad/pleiepenger
FRONTEND_API_PATH: http://localhost:8082/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
project: ./apps/pleiepenger-sykt-barn/e2e
build: yarn build-pleiepenger-sykt-barn
start: yarn turbo start-e2e-server --filter=pleiepenger-sykt-barn
wait-on: 'http://localhost:8080'
wait-on-timeout: 60
runTests: false

- name: Run cypress tests
run: yarn turbo cypress-run --filter=pleiepenger-sykt-barn

deploy-to-prod:
name: Deploy pleiepenger-sykt-barn to prod
needs: [run-tests]
uses: navikt/sif-brukerdialog/.github/workflows/.deploy-app-to-prod.yml@main
secrets: inherit
permissions:
contents: write
security-events: write
id-token: write
actions: read
with:
app-name: 'pleiepenger-sykt-barn'
working-directory: 'apps/pleiepenger-sykt-barn'
run-tests:
uses: ./.github/workflows/test.pleiepenger-sykt-barn.yml
secrets: inherit

deploy-to-prod:
name: Deploy pleiepenger-sykt-barn to prod
needs: [run-tests]
uses: ./.github/workflows/.deploy-app-to-prod.yml
secrets: inherit
permissions:
contents: write
security-events: write
id-token: write
actions: read
with:
app-name: 'pleiepenger-sykt-barn'
working-directory: 'apps/pleiepenger-sykt-barn'
Loading

0 comments on commit f83de9e

Please sign in to comment.