Skip to content

Commit

Permalink
👷 Fjerner labs fra github actions og støtter yarn berry i alle actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tidnav committed Feb 27, 2024
1 parent c374542 commit dac4918
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 211 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
- main
paths-ignore:
- '**.md'
env:
IMAGE_BASE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/aap/${{ github.event.repository.name }}
jobs:
buildDev:
uses: navikt/aap-workflows/.github/workflows/frontend-next-build.yml@frontend-next-build-yarnberry
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/build-dev-mock-historisk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Labs: historisk snapshot"
on:
workflow_dispatch:
push:
branches:
- "labs-historisk-**"
env:
"IMAGE": "ghcr.io/${{ github.repository }}-labs-historisk:${{ github.sha }}"
jobs:
buildMock:
name: build
runs-on: ubuntu-latest
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
SKIP_YARN_COREPACK_CHECK: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Enable Corepack
run: corepack enable
- name: Cache client node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- name: install dependencies Yarn
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Copy env-file # TODO: Se om vi kan finne en bedre løsning her på sikt
run: cp .nais/dev-mock.env .env
- name: run build
run: yarn run build
- uses: nais/docker-build-push@v0
with:
team: aap
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
image_suffix: -dev-gcp-mock-historisk
tag: ${{ github.sha }}
"deployAppToLabsHistorisk":
name: "Deploy branch to dev"
needs: "buildMock"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: gacts/github-slug@v1
id: slug
with:
to-slug: aap-soknad-${{ github.ref_name }}
- name: "Deploy historisk søknad til dev"
uses: "nais/deploy/actions/deploy@v1"
env:
"APIKEY": "${{ secrets.NAIS_DEPLOY_APIKEY }}"
"CLUSTER": "dev-gcp"
"RESOURCE": ".nais/historisk-dev-mock.yaml"
"VAR": image=${{ env.IMAGE }},ingress=https://${{ steps.slug.outputs.slug }}.ekstern.dev.nav.no,appname=${{ steps.slug.outputs.slug }},replicas=1,branchState=alive
57 changes: 57 additions & 0 deletions .github/workflows/build-dev-mock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and deploy mocket versjon av aap-soknad
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- '**.md'
env:
IMAGE_SUFFIX: dev-gcp-mock
jobs:
buildMock:
name: build
runs-on: ubuntu-latest
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
SKIP_YARN_COREPACK_CHECK: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://npm.pkg.github.com
cache: yarn
- name: Enable Corepack
run: corepack enable
- name: Cache client node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}
- name: install dependencies Yarn
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Copy env-file # TODO: Se om vi kan finne en bedre løsning her på sikt
run: cp .nais/dev-mock.env .env
- name: run build
run: yarn run build
- uses: nais/docker-build-push@v0
with:
team: aap
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
image_suffix: -dev-gcp-mock
tag: ${{ github.sha }}
deployMock:
needs: buildMock
uses: navikt/aap-workflows/.github/workflows/deploy.yml@main
permissions:
contents: read
id-token: write
secrets: inherit
with:
cluster: dev-gcp
manifest: .nais/dev-mock.yaml
imageSuffix: -dev-gcp-mock
64 changes: 0 additions & 64 deletions .github/workflows/build-labs-historisk.yaml

This file was deleted.

96 changes: 0 additions & 96 deletions .github/workflows/build-labs-mock.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
name: Delete branch labs-gcp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Scale down labs-gcp
- uses: actions/checkout@v4
- name: Scale down dev-gcp-mock-historisk
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: ".nais/historisk-labs.yaml"
RESOURCE: ".nais/historisk-dev-mock.yaml"
VAR: image=${{ env.IMAGE }},appname=${{env.APP_NAME}},ingress=https://${{env.APP_NAME}}.ekstern.dev.nav.no,replicas=0,branchState=deleted
2 changes: 1 addition & 1 deletion .nais/labs.env → .nais/dev-mock.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RUNTIME_ENVIRONMENT="labs"
RUNTIME_ENVIRONMENT="localhost"
DECORATOR_ENV="dev"
SOKNAD_API_URL="https://aap-soknad-api.dev.intern.nav.no"
SOKNAD_API_AUDIENCE="dev-gcp:aap:soknad-api"
Expand Down
6 changes: 3 additions & 3 deletions .nais/labs-gcp.yaml → .nais/dev-mock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ spec:
initialDelay: 20
timeout: 60
replicas:
min: 2
max: 2
min: 1
max: 1
accessPolicy:
outbound:
external:
- host: "dekoratoren.ekstern.dev.nav.no"
- host: "dekoratoren.ekstern.dev.nav.no"
23 changes: 0 additions & 23 deletions .nais/frozen-labs.yaml

This file was deleted.

File renamed without changes.
19 changes: 0 additions & 19 deletions DockerfileLabs

This file was deleted.

0 comments on commit dac4918

Please sign in to comment.