From 77376fe45f781fd5e35ab63ddd5c3443db8ccb1e Mon Sep 17 00:00:00 2001 From: taniaholst Date: Mon, 24 Feb 2025 15:53:52 +0100 Subject: [PATCH 01/12] automatic release --- .github/workflows/build-and-test.yml | 2 +- .github/workflows/build-image.yml | 6 ++-- .github/workflows/deploy-alerts.yml | 2 +- .github/workflows/deploy-failover.dev.yml | 2 +- .github/workflows/deploy-failover.prod.yml | 6 ++-- .github/workflows/deploy-storybook.yml | 2 +- .github/workflows/deploy-to-nais.yml | 2 +- .github/workflows/deploy.dev1.yml | 6 ++-- .github/workflows/deploy.dev2.yml | 6 ++-- .github/workflows/deploy.prod.yml | 32 ++++++++++++++++++---- 10 files changed, 43 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b0cc9a867..325832dc1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -12,7 +12,7 @@ jobs: - name: Setup node.js uses: actions/setup-node@v3 with: - node-version: '20' + node-version: 20 registry-url: 'https://npm.pkg.github.com' cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 708e676b9..96f2a652e 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -67,8 +67,8 @@ jobs: name: Build docker image runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: read + id-token: write environment: ${{ inputs.environment }} outputs: image: ${{ steps.docker-push.outputs.image }} @@ -78,7 +78,7 @@ jobs: - name: Setup node.js uses: actions/setup-node@v4 with: - node-version: '20' + node-version: 20 registry-url: 'https://npm.pkg.github.com' cache: 'npm' - name: Set app environmment diff --git a/.github/workflows/deploy-alerts.yml b/.github/workflows/deploy-alerts.yml index 793b3f708..2036e948f 100644 --- a/.github/workflows/deploy-alerts.yml +++ b/.github/workflows/deploy-alerts.yml @@ -11,7 +11,7 @@ jobs: name: Deploy nais-alerts runs-on: ubuntu-latest permissions: - id-token: "write" + id-token: write steps: - name: Checkout repo uses: actions/checkout@v3 diff --git a/.github/workflows/deploy-failover.dev.yml b/.github/workflows/deploy-failover.dev.yml index 86ee93e6a..c1b5ab914 100644 --- a/.github/workflows/deploy-failover.dev.yml +++ b/.github/workflows/deploy-failover.dev.yml @@ -19,7 +19,7 @@ jobs: deploy: uses: ./.github/workflows/deploy-to-nais.yml permissions: - id-token: "write" + id-token: write with: image: ghcr.io/${{ github.repository }}:${{ github.event.inputs.image_name }} cluster: dev-gcp diff --git a/.github/workflows/deploy-failover.prod.yml b/.github/workflows/deploy-failover.prod.yml index 60d398ef3..189ea2ae9 100644 --- a/.github/workflows/deploy-failover.prod.yml +++ b/.github/workflows/deploy-failover.prod.yml @@ -8,8 +8,8 @@ jobs: build: uses: ./.github/workflows/build-image.yml permissions: - contents: "read" - id-token: "write" + contents: read + id-token: write with: environment: prod-gcp:failover imagename: failover-prod @@ -34,7 +34,7 @@ jobs: uses: ./.github/workflows/deploy-to-nais.yml needs: build permissions: - id-token: "write" + id-token: write with: image: ${{ needs.build.outputs.image }} cluster: prod-gcp diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml index 806e2de66..f6da4e355 100644 --- a/.github/workflows/deploy-storybook.yml +++ b/.github/workflows/deploy-storybook.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: '20' + node-version: 20 registry-url: 'https://npm.pkg.github.com' cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/deploy-to-nais.yml b/.github/workflows/deploy-to-nais.yml index b8ba814eb..62d1fdea0 100644 --- a/.github/workflows/deploy-to-nais.yml +++ b/.github/workflows/deploy-to-nais.yml @@ -26,7 +26,7 @@ jobs: name: Deploy to nais k8s runs-on: ubuntu-latest permissions: - id-token: "write" + id-token: write steps: - name: Checkout repo uses: actions/checkout@v4 diff --git a/.github/workflows/deploy.dev1.yml b/.github/workflows/deploy.dev1.yml index c1517ce75..c84cbae55 100644 --- a/.github/workflows/deploy.dev1.yml +++ b/.github/workflows/deploy.dev1.yml @@ -15,8 +15,8 @@ jobs: build: uses: ./.github/workflows/build-image.yml permissions: - contents: "read" - id-token: "write" + contents: read + id-token: write with: environment: dev-gcp:dev1 imagename: dev1-deploy @@ -41,7 +41,7 @@ jobs: uses: ./.github/workflows/deploy-to-nais.yml needs: build permissions: - id-token: "write" + id-token: write with: image: ${{ needs.build.outputs.image }} cluster: dev-gcp diff --git a/.github/workflows/deploy.dev2.yml b/.github/workflows/deploy.dev2.yml index d671bebb9..3afedac3b 100644 --- a/.github/workflows/deploy.dev2.yml +++ b/.github/workflows/deploy.dev2.yml @@ -15,8 +15,8 @@ jobs: build: uses: ./.github/workflows/build-image.yml permissions: - contents: "read" - id-token: "write" + contents: read + id-token: write with: environment: dev-gcp:dev2 imagename: dev2-deploy @@ -41,7 +41,7 @@ jobs: uses: ./.github/workflows/deploy-to-nais.yml needs: build permissions: - id-token: "write" + id-token: write with: image: ${{ needs.build.outputs.image }} cluster: dev-gcp diff --git a/.github/workflows/deploy.prod.yml b/.github/workflows/deploy.prod.yml index 13f710b10..5883b0c29 100644 --- a/.github/workflows/deploy.prod.yml +++ b/.github/workflows/deploy.prod.yml @@ -1,15 +1,15 @@ name: Deploy to prod on: - release: - types: [released] + push: + branches: + - main jobs: build: - if: github.event.release.target_commitish == 'main' uses: ./.github/workflows/build-image.yml permissions: - contents: "read" - id-token: "write" + contents: read + id-token: write with: environment: prod-gcp imagename: release-${{ github.ref_name }} @@ -34,7 +34,7 @@ jobs: uses: ./.github/workflows/deploy-to-nais.yml needs: build permissions: - id-token: "write" + id-token: write with: image: ${{ needs.build.outputs.image }} cluster: prod-gcp @@ -42,3 +42,23 @@ jobs: config_file: config.yml hpa_file: hpa-prod.yml deploy_redis: true + + release: + name: Create a new release + needs: deploy + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Generate unique tag name + run: echo "TAG_NAME=$(date +%s)" >> $GITHUB_ENV + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + target_commitish: main + tag_name: release/prod@${{ env.TAG_NAME }} # Generates a unique tag using timestamp + name: Release ${{ github.ref_name }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # This is a PAT with repo permissions \ No newline at end of file From f261377416d9ef2e10efc73e9606e151693df0e2 Mon Sep 17 00:00:00 2001 From: taniaholst Date: Mon, 24 Feb 2025 16:08:33 +0100 Subject: [PATCH 02/12] fjernet prettierignore --- .github/workflows/build-and-test.yml | 44 ++-- .github/workflows/build-image.yml | 264 ++++++++++----------- .github/workflows/deploy-alerts.yml | 36 +-- .github/workflows/deploy-failover.dev.yml | 46 ++-- .github/workflows/deploy-failover.prod.yml | 78 +++--- .github/workflows/deploy-storybook.yml | 74 +++--- .github/workflows/deploy-to-nais.yml | 104 ++++---- .github/workflows/deploy.dev1.yml | 94 ++++---- .github/workflows/deploy.dev2.yml | 94 ++++---- .github/workflows/deploy.prod.yml | 118 ++++----- .prettierignore | 1 - 11 files changed, 476 insertions(+), 477 deletions(-) delete mode 100644 .prettierignore diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 325832dc1..fd1656761 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,27 +1,27 @@ name: Build and test on: - push: + push: jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Setup node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - registry-url: 'https://npm.pkg.github.com' - cache: 'npm' - - name: Install dependencies - run: npm ci --ignore-scripts - env: - NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} - - name: Run linting - run: npm run lint - - name: Build application - run: npm run build-local - - name: Run tests - run: npm run test + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Setup node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + registry-url: 'https://npm.pkg.github.com' + cache: 'npm' + - name: Install dependencies + run: npm ci --ignore-scripts + env: + NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} + - name: Run linting + run: npm run lint + - name: Build application + run: npm run build-local + - name: Run tests + run: npm run test diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 96f2a652e..46c3eb785 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -1,136 +1,136 @@ name: Build docker image on: - workflow_call: - inputs: - environment: - required: true - type: string - imagename: - required: true - type: string - ENV: - required: true - type: string - ADMIN_ORIGIN: - required: true - type: string - APP_ORIGIN: - required: true - type: string - REVALIDATOR_PROXY_ORIGIN: - required: true - type: string - DECORATOR_URL: - required: true - type: string - XP_ORIGIN: - required: true - type: string - TELEMETRY_URL: - required: true - type: string - INNLOGGINGSSTATUS_URL: - required: true - type: string - MELDEKORT_API_URL: - required: true - type: string - NAVNO_SEARCH_API_URL: - required: true - type: string - FAILOVER_ORIGIN: - required: true - type: string - RELEASE_TAG: - required: false - type: string - IS_FAILOVER_INSTANCE: - required: false - type: boolean - NODE_ENV: - required: true - type: string - secrets: - READER_TOKEN: - required: true - SERVICE_SECRET: - required: false - NAIS_WORKLOAD_IDENTITY_PROVIDER: - required: true - outputs: - image: - description: "Url to docker image" - value: ${{ jobs.build_image.outputs.image }} + workflow_call: + inputs: + environment: + required: true + type: string + imagename: + required: true + type: string + ENV: + required: true + type: string + ADMIN_ORIGIN: + required: true + type: string + APP_ORIGIN: + required: true + type: string + REVALIDATOR_PROXY_ORIGIN: + required: true + type: string + DECORATOR_URL: + required: true + type: string + XP_ORIGIN: + required: true + type: string + TELEMETRY_URL: + required: true + type: string + INNLOGGINGSSTATUS_URL: + required: true + type: string + MELDEKORT_API_URL: + required: true + type: string + NAVNO_SEARCH_API_URL: + required: true + type: string + FAILOVER_ORIGIN: + required: true + type: string + RELEASE_TAG: + required: false + type: string + IS_FAILOVER_INSTANCE: + required: false + type: boolean + NODE_ENV: + required: true + type: string + secrets: + READER_TOKEN: + required: true + SERVICE_SECRET: + required: false + NAIS_WORKLOAD_IDENTITY_PROVIDER: + required: true + outputs: + image: + description: 'Url to docker image' + value: ${{ jobs.build_image.outputs.image }} jobs: - build_image: - name: Build docker image - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - environment: ${{ inputs.environment }} - outputs: - image: ${{ steps.docker-push.outputs.image }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Setup node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: 'https://npm.pkg.github.com' - cache: 'npm' - - name: Set app environmment - run: | - cat > .env < .env <> $GITHUB_ENV - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 + build: + uses: ./.github/workflows/build-image.yml + permissions: + contents: read + id-token: write + with: + environment: prod-gcp + imagename: release-${{ github.ref_name }} + ENV: prod + ADMIN_ORIGIN: https://portal-admin.oera.no + APP_ORIGIN: https://www.nav.no + REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy + DECORATOR_URL: https://www.nav.no/nav-dekoratoren + XP_ORIGIN: https://www.nav.no + TELEMETRY_URL: https://telemetry.nav.no/collect + INNLOGGINGSSTATUS_URL: https://www.nav.no/person/nav-dekoratoren-api/auth + NAVNO_SEARCH_API_URL: https://navno-search-api.nav.no/content/search-url + RELEASE_TAG: ${{ github.ref_name }} + MELDEKORT_API_URL: https://meldekort-api.nav.no/meldekort/meldekort-api/api/person + FAILOVER_ORIGIN: https://www-failover.nav.no + NODE_ENV: production + secrets: + READER_TOKEN: ${{ secrets.READER_TOKEN }} + SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} + NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} + deploy: + uses: ./.github/workflows/deploy-to-nais.yml + needs: build + permissions: + id-token: write with: - target_commitish: main - tag_name: release/prod@${{ env.TAG_NAME }} # Generates a unique tag using timestamp - name: Release ${{ github.ref_name }} - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # This is a PAT with repo permissions \ No newline at end of file + image: ${{ needs.build.outputs.image }} + cluster: prod-gcp + vars_file: vars-prod.yml + config_file: config.yml + hpa_file: hpa-prod.yml + deploy_redis: true + + release: + name: Create a new release + needs: deploy + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Generate unique tag name + run: echo "TAG_NAME=$(date +%s)" >> $GITHUB_ENV + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + target_commitish: main + tag_name: release/prod@${{ env.TAG_NAME }} # Generates a unique tag using timestamp + name: Release ${{ github.ref_name }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # This is a PAT with repo permissions diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 8d98c0998..000000000 --- a/.prettierignore +++ /dev/null @@ -1 +0,0 @@ -**/*.yml \ No newline at end of file From 70e1b40a69ba02219a66bbf8325c3cc682cd57f3 Mon Sep 17 00:00:00 2001 From: Terje Karlsen Date: Thu, 13 Feb 2025 13:33:30 +0100 Subject: [PATCH 03/12] Migrere fra Redis til Valkey --- .github/workflows/deploy-to-nais.yml | 104 +++++++++++++-------------- .github/workflows/deploy.dev1.yml | 74 +++++++++---------- .github/workflows/deploy.dev2.yml | 74 +++++++++---------- .github/workflows/deploy.prod.yml | 2 +- .nais/config.yml | 4 +- .nais/{redis.yml => valkey.yml} | 18 ++--- .nais/vars/vars-dev1.yml | 2 +- .nais/vars/vars-dev2.yml | 2 +- .nais/vars/vars-prod.yml | 2 +- docker-compose.yml | 2 +- nodeenv.d.ts | 6 +- srcCommon/redis.ts | 20 +++--- 12 files changed, 155 insertions(+), 155 deletions(-) rename .nais/{redis.yml => valkey.yml} (51%) diff --git a/.github/workflows/deploy-to-nais.yml b/.github/workflows/deploy-to-nais.yml index 4d499537d..00095aae7 100644 --- a/.github/workflows/deploy-to-nais.yml +++ b/.github/workflows/deploy-to-nais.yml @@ -1,56 +1,56 @@ name: Deploy to nais on: - workflow_call: - inputs: - image: - required: true - type: string - cluster: - required: true - type: string - config_file: - required: true - type: string - vars_file: - required: true - type: string - hpa_file: - required: false - type: string - deploy_redis: - required: false - type: boolean + workflow_call: + inputs: + image: + required: true + type: string + cluster: + required: true + type: string + config_file: + required: true + type: string + vars_file: + required: true + type: string + hpa_file: + required: false + type: string + deploy_valkey: + required: false + type: boolean jobs: - deploy: - name: Deploy to nais k8s - runs-on: ubuntu-latest - permissions: - id-token: write - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Deploy Redis - if: ${{ inputs.deploy_redis == true }} - uses: nais/deploy/actions/deploy@v2 - timeout-minutes: 1 - continue-on-error: true - env: - CLUSTER: ${{ inputs.cluster }} - RESOURCE: .nais/redis.yml - VARS: .nais/vars/${{ inputs.vars_file }} - - name: Deploy HPA - if: ${{ inputs.hpa_file }} - uses: nais/deploy/actions/deploy@v2 - timeout-minutes: 1 - continue-on-error: true - env: - CLUSTER: ${{ inputs.cluster }} - RESOURCE: .nais/hpa/${{inputs.hpa_file}} - - name: Deploy application - uses: nais/deploy/actions/deploy@v2 - env: - CLUSTER: ${{ inputs.cluster }} - RESOURCE: .nais/${{ inputs.config_file }} - VAR: image=${{ inputs.image }} - VARS: .nais/vars/${{ inputs.vars_file }} + deploy: + name: Deploy to nais k8s + runs-on: ubuntu-latest + permissions: + id-token: "write" + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Deploy Valkey + if: ${{ inputs.deploy_valkey == true }} + uses: nais/deploy/actions/deploy@v2 + timeout-minutes: 1 + continue-on-error: true + env: + CLUSTER: ${{ inputs.cluster }} + RESOURCE: .nais/valkey.yml + VARS: .nais/vars/${{ inputs.vars_file }} + - name: Deploy HPA + if: ${{ inputs.hpa_file }} + uses: nais/deploy/actions/deploy@v2 + timeout-minutes: 1 + continue-on-error: true + env: + CLUSTER: ${{ inputs.cluster }} + RESOURCE: .nais/hpa/${{inputs.hpa_file}} + - name: Deploy application + uses: nais/deploy/actions/deploy@v2 + env: + CLUSTER: ${{ inputs.cluster }} + RESOURCE: .nais/${{ inputs.config_file }} + VAR: image=${{ inputs.image }} + VARS: .nais/vars/${{ inputs.vars_file }} diff --git a/.github/workflows/deploy.dev1.yml b/.github/workflows/deploy.dev1.yml index 0cb48d4ac..c83e2ac9e 100644 --- a/.github/workflows/deploy.dev1.yml +++ b/.github/workflows/deploy.dev1.yml @@ -12,40 +12,40 @@ on: - development jobs: - build: - uses: ./.github/workflows/build-image.yml - permissions: - contents: read - id-token: write - with: - environment: dev-gcp:dev1 - imagename: dev1-deploy - ENV: dev1 - ADMIN_ORIGIN: https://portal-admin-dev.oera.no - APP_ORIGIN: https://www.ansatt.dev.nav.no - REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy-dev1 - DECORATOR_URL: https://dekoratoren.ekstern.dev.nav.no - XP_ORIGIN: https://www.dev.nav.no - TELEMETRY_URL: https://telemetry.ekstern.dev.nav.no/collect - INNLOGGINGSSTATUS_URL: https://www.ekstern.dev.nav.no/person/nav-dekoratoren-api/auth - RELEASE_TAG: dev1-${{ github.sha }} - NAVNO_SEARCH_API_URL: https://navno-search-api.ekstern.dev.nav.no/content/search-url - MELDEKORT_API_URL: https://meldekort-api-q1.intern.dev.nav.no/meldekort/meldekort-api/api/person - FAILOVER_ORIGIN: https://www-failover.intern.dev.nav.no - NODE_ENV: ${{ inputs.NODE_ENV }} - secrets: - READER_TOKEN: ${{ secrets.READER_TOKEN }} - SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} - NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} - deploy: - uses: ./.github/workflows/deploy-to-nais.yml - needs: build - permissions: - id-token: write - with: - image: ${{ needs.build.outputs.image }} - cluster: dev-gcp - vars_file: vars-dev1.yml - config_file: config.yml - hpa_file: hpa-dev1.yml - deploy_redis: true + build: + uses: ./.github/workflows/build-image.yml + permissions: + contents: "read" + id-token: "write" + with: + environment: dev-gcp:dev1 + imagename: dev1-deploy + ENV: dev1 + ADMIN_ORIGIN: https://portal-admin-dev.oera.no + APP_ORIGIN: https://www.ansatt.dev.nav.no + REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy-dev1 + DECORATOR_URL: https://dekoratoren.ekstern.dev.nav.no + XP_ORIGIN: https://www.dev.nav.no + TELEMETRY_URL: https://telemetry.ekstern.dev.nav.no/collect + INNLOGGINGSSTATUS_URL: https://www.ekstern.dev.nav.no/person/nav-dekoratoren-api/auth + RELEASE_TAG: dev1-${{ github.sha }} + NAVNO_SEARCH_API_URL: https://navno-search-api.ekstern.dev.nav.no/content/search-url + MELDEKORT_API_URL: https://meldekort-api-q1.intern.dev.nav.no/meldekort/meldekort-api/api/person + FAILOVER_ORIGIN: https://www-failover.intern.dev.nav.no + NODE_ENV: ${{ inputs.NODE_ENV }} + secrets: + READER_TOKEN: ${{ secrets.READER_TOKEN }} + SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} + NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} + deploy: + uses: ./.github/workflows/deploy-to-nais.yml + needs: build + permissions: + id-token: "write" + with: + image: ${{ needs.build.outputs.image }} + cluster: dev-gcp + vars_file: vars-dev1.yml + config_file: config.yml + hpa_file: hpa-dev1.yml + deploy_valkey: true diff --git a/.github/workflows/deploy.dev2.yml b/.github/workflows/deploy.dev2.yml index 8d2837da8..d1b9063b3 100644 --- a/.github/workflows/deploy.dev2.yml +++ b/.github/workflows/deploy.dev2.yml @@ -12,40 +12,40 @@ on: - development jobs: - build: - uses: ./.github/workflows/build-image.yml - permissions: - contents: read - id-token: write - with: - environment: dev-gcp:dev2 - imagename: dev2-deploy - ENV: dev2 - ADMIN_ORIGIN: https://portal-admin-q6.oera.no - APP_ORIGIN: https://www-2.ansatt.dev.nav.no - REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy-dev2 - DECORATOR_URL: https://dekoratoren-beta.intern.dev.nav.no - XP_ORIGIN: https://www-q6.nav.no - TELEMETRY_URL: https://telemetry.ekstern.dev.nav.no/collect - INNLOGGINGSSTATUS_URL: https://www.ekstern.dev.nav.no/person/nav-dekoratoren-api/auth - RELEASE_TAG: dev2-${{ github.sha }} - MELDEKORT_API_URL: https://meldekort-api-q1.intern.dev.nav.no/meldekort/meldekort-api/api/person - NAVNO_SEARCH_API_URL: https://navno-search-api.ekstern.dev.nav.no/content/search-url - FAILOVER_ORIGIN: https://www-2-failover.intern.dev.nav.no - NODE_ENV: ${{ inputs.NODE_ENV }} - secrets: - READER_TOKEN: ${{ secrets.READER_TOKEN }} - SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} - NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} - deploy: - uses: ./.github/workflows/deploy-to-nais.yml - needs: build - permissions: - id-token: write - with: - image: ${{ needs.build.outputs.image }} - cluster: dev-gcp - vars_file: vars-dev2.yml - config_file: config.yml - hpa_file: hpa-dev2.yml - deploy_redis: true + build: + uses: ./.github/workflows/build-image.yml + permissions: + contents: read + id-token: write + with: + environment: dev-gcp:dev2 + imagename: dev2-deploy + ENV: dev2 + ADMIN_ORIGIN: https://portal-admin-q6.oera.no + APP_ORIGIN: https://www-2.ansatt.dev.nav.no + REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy-dev2 + DECORATOR_URL: https://dekoratoren-beta.intern.dev.nav.no + XP_ORIGIN: https://www-q6.nav.no + TELEMETRY_URL: https://telemetry.ekstern.dev.nav.no/collect + INNLOGGINGSSTATUS_URL: https://www.ekstern.dev.nav.no/person/nav-dekoratoren-api/auth + RELEASE_TAG: dev2-${{ github.sha }} + MELDEKORT_API_URL: https://meldekort-api-q1.intern.dev.nav.no/meldekort/meldekort-api/api/person + NAVNO_SEARCH_API_URL: https://navno-search-api.ekstern.dev.nav.no/content/search-url + FAILOVER_ORIGIN: https://www-2-failover.intern.dev.nav.no + NODE_ENV: ${{ inputs.NODE_ENV }} + secrets: + READER_TOKEN: ${{ secrets.READER_TOKEN }} + SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} + NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} + deploy: + uses: ./.github/workflows/deploy-to-nais.yml + needs: build + permissions: + id-token: "write" + with: + image: ${{ needs.build.outputs.image }} + cluster: dev-gcp + vars_file: vars-dev2.yml + config_file: config.yml + hpa_file: hpa-dev2.yml + deploy_valkey: true diff --git a/.github/workflows/deploy.prod.yml b/.github/workflows/deploy.prod.yml index 9e210e50c..4d91027c2 100644 --- a/.github/workflows/deploy.prod.yml +++ b/.github/workflows/deploy.prod.yml @@ -41,7 +41,7 @@ jobs: vars_file: vars-prod.yml config_file: config.yml hpa_file: hpa-prod.yml - deploy_redis: true + deploy_valkey: true release: name: Create a new release diff --git a/.nais/config.yml b/.nais/config.yml index 11edc45c5..37d4118f9 100644 --- a/.nais/config.yml +++ b/.nais/config.yml @@ -27,8 +27,8 @@ spec: prometheus: enabled: true path: /internal/metrics - redis: - - instance: {{ redis.instance }} + valkey: + - instance: {{ valkey.instance }} access: readwrite ingresses: {{#each ingresses as |url|}} diff --git a/.nais/redis.yml b/.nais/valkey.yml similarity index 51% rename from .nais/redis.yml rename to .nais/valkey.yml index 4a7e00200..c0bb0c79d 100644 --- a/.nais/redis.yml +++ b/.nais/valkey.yml @@ -1,18 +1,18 @@ apiVersion: aiven.io/v1alpha1 -kind: Redis +kind: Valkey metadata: labels: app: nav-enonicxp-frontend team: personbruker - name: redis-personbruker-{{ redis.instance }} + name: valkey-personbruker-{{ valkey.instance }} namespace: personbruker spec: - plan: {{ redis.plan }} - project: {{ redis.project }} + plan: {{ valkey.plan }} + project: {{ valkey.project }} maintenanceWindowDow: saturday maintenanceWindowTime: 20:00:00 userConfig: - redis_maxmemory_policy: allkeys-lru + valkey_maxmemory_policy: allkeys-lru --- apiVersion: aiven.io/v1alpha1 @@ -20,10 +20,10 @@ kind: ServiceIntegration metadata: labels: team: personbruker - name: redis-personbruker-{{ redis.instance }} + name: valkey-personbruker-{{ valkey.instance }} namespace: personbruker spec: - project: {{ redis.project }} + project: {{ valkey.project }} integrationType: prometheus - destinationEndpointId: {{ redis.endpointId }} - sourceServiceName: redis-personbruker-{{ redis.instance }} + destinationEndpointId: {{ valkey.endpointId }} + sourceServiceName: valkey-personbruker-{{ valkey.instance }} diff --git a/.nais/vars/vars-dev1.yml b/.nais/vars/vars-dev1.yml index c791c93fd..63b88599b 100644 --- a/.nais/vars/vars-dev1.yml +++ b/.nais/vars/vars-dev1.yml @@ -15,7 +15,7 @@ resources: memory: 1000Mi limits: memory: 2000Mi -redis: +valkey: plan: hobbyist project: nav-dev instance: pagecache diff --git a/.nais/vars/vars-dev2.yml b/.nais/vars/vars-dev2.yml index 0315eb5db..faf605ebe 100644 --- a/.nais/vars/vars-dev2.yml +++ b/.nais/vars/vars-dev2.yml @@ -16,7 +16,7 @@ resources: memory: 500Mi limits: memory: 1000Mi -redis: +valkey: plan: hobbyist project: nav-dev instance: pagecache diff --git a/.nais/vars/vars-prod.yml b/.nais/vars/vars-prod.yml index 823ec6bdd..6b5d850f6 100644 --- a/.nais/vars/vars-prod.yml +++ b/.nais/vars/vars-prod.yml @@ -13,7 +13,7 @@ resources: memory: 2048Mi limits: memory: 4096Mi -redis: +valkey: plan: startup-4 project: nav-prod instance: pagecache diff --git a/docker-compose.yml b/docker-compose.yml index 4d54e8b3a..119271371 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: - '3002:3002' environment: SERVICE_SECRET: 'dummyToken' - NO_REDIS: true + NO_VALKEY: true dekoratoren: container_name: dekoratoren-xpfrontend diff --git a/nodeenv.d.ts b/nodeenv.d.ts index 09e06c207..17a00243b 100644 --- a/nodeenv.d.ts +++ b/nodeenv.d.ts @@ -20,9 +20,9 @@ declare global { ASSET_PREFIX: string; TELEMETRY_URL: string; NEXT_PHASE: string; - REDIS_URI_PAGECACHE: string; - REDIS_USERNAME_PAGECACHE: string; - REDIS_PASSWORD_PAGECACHE: string; + VALKEY_URI_PAGECACHE: string; + VALKEY_USERNAME_PAGECACHE: string; + VALKEY_PASSWORD_PAGECACHE: string; DECORATOR_NOCACHE?: 'true' | 'false'; } } diff --git a/srcCommon/redis.ts b/srcCommon/redis.ts index 901862703..583eda851 100644 --- a/srcCommon/redis.ts +++ b/srcCommon/redis.ts @@ -9,9 +9,9 @@ import { pathToCacheKey } from 'srcCommon/cache-key'; type XpResponseProps = Record; const clientOptions: RedisClientOptions = { - url: process.env.REDIS_URI_PAGECACHE, - username: process.env.REDIS_USERNAME_PAGECACHE, - password: process.env.REDIS_PASSWORD_PAGECACHE, + url: process.env.VALKEY_URI_PAGECACHE, + username: process.env.VALKEY_USERNAME_PAGECACHE, + password: process.env.VALKEY_PASSWORD_PAGECACHE, socket: { keepAlive: 5000, connectTimeout: 10000 }, } as const; @@ -19,7 +19,7 @@ const validateClientOptions = () => { const isValid = !!(clientOptions.url && clientOptions.username && clientOptions.password); if (!isValid) { - logger.error(`Client options for Redis has missing parameters!`); + logger.error(`Client options for Valkey has missing parameters!`); } return isValid; @@ -39,19 +39,19 @@ class RedisCacheImpl { constructor() { this.client = createClient(clientOptions) .on('connect', () => { - logger.info('Redis client connected'); + logger.info('Valkey client connected'); }) .on('ready', () => { - logger.info('Redis client ready'); + logger.info('Valkey client ready'); }) .on('end', () => { - logger.info('Redis client connection closed'); + logger.info('Valkey client connection closed'); }) .on('reconnecting', () => { - logger.info('Redis client reconnecting'); + logger.info('Valkey client reconnecting'); }) .on('error', (err) => { - logger.error(`Redis client error: ${err}`); + logger.error(`Valkey client error: ${err}`); }); } @@ -61,7 +61,7 @@ class RedisCacheImpl { return this.client.connect().then(() => { logger.info( - `Initialized redis client with url ${clientOptions.url} - Render key prefix: ${this.renderCacheKeyPrefix} - Response key prefix: ${this.responseCacheKeyPrefix}` + `Initialized valkey client with url ${clientOptions.url} - Render key prefix: ${this.renderCacheKeyPrefix} - Response key prefix: ${this.responseCacheKeyPrefix}` ); return this; }); From 943738da2aab3121b3b643e21c8a0fcabba09234 Mon Sep 17 00:00:00 2001 From: Tale Prestmo Date: Tue, 18 Feb 2025 11:23:49 +0100 Subject: [PATCH 04/12] log url+username --- srcCommon/redis.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/srcCommon/redis.ts b/srcCommon/redis.ts index 583eda851..e8aa20e13 100644 --- a/srcCommon/redis.ts +++ b/srcCommon/redis.ts @@ -37,6 +37,8 @@ class RedisCacheImpl { private renderCacheKeyPrefix = ''; constructor() { + logger.info(clientOptions.url); + logger.info(clientOptions.username); this.client = createClient(clientOptions) .on('connect', () => { logger.info('Valkey client connected'); From 016179fde8bef4bd2d9ee93f7ea2ca59e0e3012b Mon Sep 17 00:00:00 2001 From: Tale Prestmo Date: Tue, 18 Feb 2025 11:34:25 +0100 Subject: [PATCH 05/12] rename valkey url env-var on client url --- srcCommon/redis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcCommon/redis.ts b/srcCommon/redis.ts index e8aa20e13..c0d3953dd 100644 --- a/srcCommon/redis.ts +++ b/srcCommon/redis.ts @@ -9,7 +9,7 @@ import { pathToCacheKey } from 'srcCommon/cache-key'; type XpResponseProps = Record; const clientOptions: RedisClientOptions = { - url: process.env.VALKEY_URI_PAGECACHE, + url: process.env.VALKEY_URI_PAGECACHE.replace('valkeys', 'rediss'), username: process.env.VALKEY_USERNAME_PAGECACHE, password: process.env.VALKEY_PASSWORD_PAGECACHE, socket: { keepAlive: 5000, connectTimeout: 10000 }, From e711852d8e8f9bc2e90073ed08b76b3db999d7c0 Mon Sep 17 00:00:00 2001 From: Tale Prestmo Date: Tue, 18 Feb 2025 11:39:14 +0100 Subject: [PATCH 06/12] =?UTF-8?q?optional=20chaining=20p=C3=A5=20replace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcCommon/redis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcCommon/redis.ts b/srcCommon/redis.ts index c0d3953dd..6802188ed 100644 --- a/srcCommon/redis.ts +++ b/srcCommon/redis.ts @@ -9,7 +9,7 @@ import { pathToCacheKey } from 'srcCommon/cache-key'; type XpResponseProps = Record; const clientOptions: RedisClientOptions = { - url: process.env.VALKEY_URI_PAGECACHE.replace('valkeys', 'rediss'), + url: process.env.VALKEY_URI_PAGECACHE?.replace('valkeys', 'rediss'), username: process.env.VALKEY_USERNAME_PAGECACHE, password: process.env.VALKEY_PASSWORD_PAGECACHE, socket: { keepAlive: 5000, connectTimeout: 10000 }, From afbf73a665a380890e7cb8ab51c42df7246a8e60 Mon Sep 17 00:00:00 2001 From: Tale Prestmo Date: Tue, 18 Feb 2025 12:46:20 +0100 Subject: [PATCH 07/12] =?UTF-8?q?Bruk=20redis=20uri,=20peker=20ogs=C3=A5?= =?UTF-8?q?=20til=20valkey-instand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- srcCommon/redis.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcCommon/redis.ts b/srcCommon/redis.ts index 6802188ed..c3f28e97b 100644 --- a/srcCommon/redis.ts +++ b/srcCommon/redis.ts @@ -9,7 +9,7 @@ import { pathToCacheKey } from 'srcCommon/cache-key'; type XpResponseProps = Record; const clientOptions: RedisClientOptions = { - url: process.env.VALKEY_URI_PAGECACHE?.replace('valkeys', 'rediss'), + url: process.env.REDIS_URI_PAGECACHE, username: process.env.VALKEY_USERNAME_PAGECACHE, password: process.env.VALKEY_PASSWORD_PAGECACHE, socket: { keepAlive: 5000, connectTimeout: 10000 }, From a1398f5135f650dac1161d7ecf0aca9621303a34 Mon Sep 17 00:00:00 2001 From: Per Olav Mariussen <35491554+PerOlavM@users.noreply.github.com> Date: Tue, 25 Feb 2025 11:31:50 +0100 Subject: [PATCH 08/12] Html-justering PageWarning.tsx (#2179) div -> section --- src/components/_page-warnings/page-warning/PageWarning.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/_page-warnings/page-warning/PageWarning.tsx b/src/components/_page-warnings/page-warning/PageWarning.tsx index 05b391680..6844dff82 100644 --- a/src/components/_page-warnings/page-warning/PageWarning.tsx +++ b/src/components/_page-warnings/page-warning/PageWarning.tsx @@ -12,10 +12,10 @@ type Props = { export const PageWarning = ({ whiteBg, size = 'small', children }: Props) => { return ( -
+
{children} -
+ ); }; From c28267d393f2553f1a071c5c6fb5424deec32166 Mon Sep 17 00:00:00 2001 From: taniaholst Date: Mon, 24 Feb 2025 15:53:52 +0100 Subject: [PATCH 09/12] automatic release --- .github/workflows/build-image.yml | 142 ++++++++++----------- .github/workflows/deploy-failover.dev.yml | 18 +-- .github/workflows/deploy-failover.prod.yml | 72 +++++------ .github/workflows/deploy-to-nais.yml | 2 +- .github/workflows/deploy.dev1.yml | 6 +- .github/workflows/deploy.dev2.yml | 2 +- .github/workflows/deploy.prod.yml | 112 ++++++++-------- 7 files changed, 177 insertions(+), 177 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 46c3eb785..c42909f98 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -63,74 +63,74 @@ on: value: ${{ jobs.build_image.outputs.image }} jobs: - build_image: - name: Build docker image - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - environment: ${{ inputs.environment }} - outputs: - image: ${{ steps.docker-push.outputs.image }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Setup node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: 'https://npm.pkg.github.com' - cache: 'npm' - - name: Set app environmment - run: | - cat > .env < .env <> $GITHUB_ENV - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 - with: - target_commitish: main - tag_name: release/prod@${{ env.TAG_NAME }} # Generates a unique tag using timestamp - name: Release ${{ github.ref_name }} - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # This is a PAT with repo permissions + release: + name: Create a new release + needs: deploy + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Generate unique tag name + run: echo "TAG_NAME=$(date +%s)" >> $GITHUB_ENV + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + target_commitish: main + tag_name: release/prod@${{ env.TAG_NAME }} # Generates a unique tag using timestamp + name: Release ${{ github.ref_name }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # This is a PAT with repo permissions \ No newline at end of file From 45bb8c110547aed1466210717df30da3537e3b27 Mon Sep 17 00:00:00 2001 From: taniaholst Date: Mon, 24 Feb 2025 16:08:33 +0100 Subject: [PATCH 10/12] fjernet prettierignore --- .github/workflows/build-image.yml | 142 ++++++++++----------- .github/workflows/deploy-failover.dev.yml | 18 +-- .github/workflows/deploy-failover.prod.yml | 72 +++++------ .github/workflows/deploy.dev1.yml | 74 +++++------ .github/workflows/deploy.prod.yml | 38 +++--- 5 files changed, 172 insertions(+), 172 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index c42909f98..46c3eb785 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -63,74 +63,74 @@ on: value: ${{ jobs.build_image.outputs.image }} jobs: - build_image: - name: Build docker image - runs-on: ubuntu-latest - permissions: - contents: read - id-token: write - environment: ${{ inputs.environment }} - outputs: - image: ${{ steps.docker-push.outputs.image }} - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Setup node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: 'https://npm.pkg.github.com' - cache: 'npm' - - name: Set app environmment - run: | - cat > .env < .env <> $GITHUB_ENV - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 - with: - target_commitish: main - tag_name: release/prod@${{ env.TAG_NAME }} # Generates a unique tag using timestamp - name: Release ${{ github.ref_name }} - generate_release_notes: true - env: - GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # This is a PAT with repo permissions \ No newline at end of file + release: + name: Create a new release + needs: deploy + runs-on: ubuntu-latest + permissions: + contents: write + id-token: write + steps: + - name: Generate unique tag name + run: echo "TAG_NAME=$(date +%s)" >> $GITHUB_ENV + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + target_commitish: main + tag_name: release/prod@${{ env.TAG_NAME }} # Generates a unique tag using timestamp + name: Release ${{ github.ref_name }} + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} # This is a PAT with repo permissions From 1b77f0b67c0671fcfc5a1dba7e56a3336f3d9f3b Mon Sep 17 00:00:00 2001 From: taniaholst Date: Tue, 25 Feb 2025 12:57:03 +0100 Subject: [PATCH 11/12] rebase main --- .github/workflows/build-and-test.yml | 1 - .github/workflows/deploy-to-nais.yml | 104 +++++++++++++-------------- .github/workflows/deploy.dev2.yml | 74 +++++++++---------- .github/workflows/deploy.prod.yml | 74 +++++++++---------- 4 files changed, 126 insertions(+), 127 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fd1656761..e95932c81 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,5 +1,4 @@ name: Build and test - on: push: diff --git a/.github/workflows/deploy-to-nais.yml b/.github/workflows/deploy-to-nais.yml index 53c7ff156..5e62098ef 100644 --- a/.github/workflows/deploy-to-nais.yml +++ b/.github/workflows/deploy-to-nais.yml @@ -1,56 +1,56 @@ name: Deploy to nais on: - workflow_call: - inputs: - image: - required: true - type: string - cluster: - required: true - type: string - config_file: - required: true - type: string - vars_file: - required: true - type: string - hpa_file: - required: false - type: string - deploy_valkey: - required: false - type: boolean + workflow_call: + inputs: + image: + required: true + type: string + cluster: + required: true + type: string + config_file: + required: true + type: string + vars_file: + required: true + type: string + hpa_file: + required: false + type: string + deploy_valkey: + required: false + type: boolean jobs: - deploy: - name: Deploy to nais k8s - runs-on: ubuntu-latest - permissions: - id-token: write - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - name: Deploy Valkey - if: ${{ inputs.deploy_valkey == true }} - uses: nais/deploy/actions/deploy@v2 - timeout-minutes: 1 - continue-on-error: true - env: - CLUSTER: ${{ inputs.cluster }} - RESOURCE: .nais/valkey.yml - VARS: .nais/vars/${{ inputs.vars_file }} - - name: Deploy HPA - if: ${{ inputs.hpa_file }} - uses: nais/deploy/actions/deploy@v2 - timeout-minutes: 1 - continue-on-error: true - env: - CLUSTER: ${{ inputs.cluster }} - RESOURCE: .nais/hpa/${{inputs.hpa_file}} - - name: Deploy application - uses: nais/deploy/actions/deploy@v2 - env: - CLUSTER: ${{ inputs.cluster }} - RESOURCE: .nais/${{ inputs.config_file }} - VAR: image=${{ inputs.image }} - VARS: .nais/vars/${{ inputs.vars_file }} + deploy: + name: Deploy to nais k8s + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Deploy Valkey + if: ${{ inputs.deploy_valkey == true }} + uses: nais/deploy/actions/deploy@v2 + timeout-minutes: 1 + continue-on-error: true + env: + CLUSTER: ${{ inputs.cluster }} + RESOURCE: .nais/valkey.yml + VARS: .nais/vars/${{ inputs.vars_file }} + - name: Deploy HPA + if: ${{ inputs.hpa_file }} + uses: nais/deploy/actions/deploy@v2 + timeout-minutes: 1 + continue-on-error: true + env: + CLUSTER: ${{ inputs.cluster }} + RESOURCE: .nais/hpa/${{inputs.hpa_file}} + - name: Deploy application + uses: nais/deploy/actions/deploy@v2 + env: + CLUSTER: ${{ inputs.cluster }} + RESOURCE: .nais/${{ inputs.config_file }} + VAR: image=${{ inputs.image }} + VARS: .nais/vars/${{ inputs.vars_file }} diff --git a/.github/workflows/deploy.dev2.yml b/.github/workflows/deploy.dev2.yml index 385245431..ac603035d 100644 --- a/.github/workflows/deploy.dev2.yml +++ b/.github/workflows/deploy.dev2.yml @@ -12,40 +12,40 @@ on: - development jobs: - build: - uses: ./.github/workflows/build-image.yml - permissions: - contents: read - id-token: write - with: - environment: dev-gcp:dev2 - imagename: dev2-deploy - ENV: dev2 - ADMIN_ORIGIN: https://portal-admin-q6.oera.no - APP_ORIGIN: https://www-2.ansatt.dev.nav.no - REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy-dev2 - DECORATOR_URL: https://dekoratoren-beta.intern.dev.nav.no - XP_ORIGIN: https://www-q6.nav.no - TELEMETRY_URL: https://telemetry.ekstern.dev.nav.no/collect - INNLOGGINGSSTATUS_URL: https://www.ekstern.dev.nav.no/person/nav-dekoratoren-api/auth - RELEASE_TAG: dev2-${{ github.sha }} - MELDEKORT_API_URL: https://meldekort-api-q1.intern.dev.nav.no/meldekort/meldekort-api/api/person - NAVNO_SEARCH_API_URL: https://navno-search-api.ekstern.dev.nav.no/content/search-url - FAILOVER_ORIGIN: https://www-2-failover.intern.dev.nav.no - NODE_ENV: ${{ inputs.NODE_ENV }} - secrets: - READER_TOKEN: ${{ secrets.READER_TOKEN }} - SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} - NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} - deploy: - uses: ./.github/workflows/deploy-to-nais.yml - needs: build - permissions: - id-token: write - with: - image: ${{ needs.build.outputs.image }} - cluster: dev-gcp - vars_file: vars-dev2.yml - config_file: config.yml - hpa_file: hpa-dev2.yml - deploy_valkey: true + build: + uses: ./.github/workflows/build-image.yml + permissions: + contents: read + id-token: write + with: + environment: dev-gcp:dev2 + imagename: dev2-deploy + ENV: dev2 + ADMIN_ORIGIN: https://portal-admin-q6.oera.no + APP_ORIGIN: https://www-2.ansatt.dev.nav.no + REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy-dev2 + DECORATOR_URL: https://dekoratoren-beta.intern.dev.nav.no + XP_ORIGIN: https://www-q6.nav.no + TELEMETRY_URL: https://telemetry.ekstern.dev.nav.no/collect + INNLOGGINGSSTATUS_URL: https://www.ekstern.dev.nav.no/person/nav-dekoratoren-api/auth + RELEASE_TAG: dev2-${{ github.sha }} + MELDEKORT_API_URL: https://meldekort-api-q1.intern.dev.nav.no/meldekort/meldekort-api/api/person + NAVNO_SEARCH_API_URL: https://navno-search-api.ekstern.dev.nav.no/content/search-url + FAILOVER_ORIGIN: https://www-2-failover.intern.dev.nav.no + NODE_ENV: ${{ inputs.NODE_ENV }} + secrets: + READER_TOKEN: ${{ secrets.READER_TOKEN }} + SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} + NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} + deploy: + uses: ./.github/workflows/deploy-to-nais.yml + needs: build + permissions: + id-token: write + with: + image: ${{ needs.build.outputs.image }} + cluster: dev-gcp + vars_file: vars-dev2.yml + config_file: config.yml + hpa_file: hpa-dev2.yml + deploy_valkey: true diff --git a/.github/workflows/deploy.prod.yml b/.github/workflows/deploy.prod.yml index 907f7b904..4d91027c2 100644 --- a/.github/workflows/deploy.prod.yml +++ b/.github/workflows/deploy.prod.yml @@ -5,43 +5,43 @@ on: - main jobs: - build: - uses: ./.github/workflows/build-image.yml - permissions: - contents: read - id-token: write - with: - environment: prod-gcp - imagename: release-${{ github.ref_name }} - ENV: prod - ADMIN_ORIGIN: https://portal-admin.oera.no - APP_ORIGIN: https://www.nav.no - REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy - DECORATOR_URL: https://www.nav.no/nav-dekoratoren - XP_ORIGIN: https://www.nav.no - TELEMETRY_URL: https://telemetry.nav.no/collect - INNLOGGINGSSTATUS_URL: https://www.nav.no/person/nav-dekoratoren-api/auth - NAVNO_SEARCH_API_URL: https://navno-search-api.nav.no/content/search-url - RELEASE_TAG: ${{ github.ref_name }} - MELDEKORT_API_URL: https://meldekort-api.nav.no/meldekort/meldekort-api/api/person - FAILOVER_ORIGIN: https://www-failover.nav.no - NODE_ENV: production - secrets: - READER_TOKEN: ${{ secrets.READER_TOKEN }} - SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} - NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} - deploy: - uses: ./.github/workflows/deploy-to-nais.yml - needs: build - permissions: - id-token: write - with: - image: ${{ needs.build.outputs.image }} - cluster: prod-gcp - vars_file: vars-prod.yml - config_file: config.yml - hpa_file: hpa-prod.yml - deploy_valkey: true + build: + uses: ./.github/workflows/build-image.yml + permissions: + contents: read + id-token: write + with: + environment: prod-gcp + imagename: release-${{ github.ref_name }} + ENV: prod + ADMIN_ORIGIN: https://portal-admin.oera.no + APP_ORIGIN: https://www.nav.no + REVALIDATOR_PROXY_ORIGIN: http://nav-enonicxp-frontend-revalidator-proxy + DECORATOR_URL: https://www.nav.no/nav-dekoratoren + XP_ORIGIN: https://www.nav.no + TELEMETRY_URL: https://telemetry.nav.no/collect + INNLOGGINGSSTATUS_URL: https://www.nav.no/person/nav-dekoratoren-api/auth + NAVNO_SEARCH_API_URL: https://navno-search-api.nav.no/content/search-url + RELEASE_TAG: ${{ github.ref_name }} + MELDEKORT_API_URL: https://meldekort-api.nav.no/meldekort/meldekort-api/api/person + FAILOVER_ORIGIN: https://www-failover.nav.no + NODE_ENV: production + secrets: + READER_TOKEN: ${{ secrets.READER_TOKEN }} + SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} + NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} + deploy: + uses: ./.github/workflows/deploy-to-nais.yml + needs: build + permissions: + id-token: write + with: + image: ${{ needs.build.outputs.image }} + cluster: prod-gcp + vars_file: vars-prod.yml + config_file: config.yml + hpa_file: hpa-prod.yml + deploy_valkey: true release: name: Create a new release From 5b0085c993e960efa5a6bae178a71faa573570f0 Mon Sep 17 00:00:00 2001 From: taniaholst Date: Tue, 25 Feb 2025 13:42:36 +0100 Subject: [PATCH 12/12] fikset variabel --- .github/workflows/deploy.dev1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.dev1.yml b/.github/workflows/deploy.dev1.yml index 5e831d3c3..6f224ad90 100644 --- a/.github/workflows/deploy.dev1.yml +++ b/.github/workflows/deploy.dev1.yml @@ -48,4 +48,4 @@ jobs: vars_file: vars-dev1.yml config_file: config.yml hpa_file: hpa-dev1.yml - deploy-valkey: true + deploy_valkey: true