Skip to content

Commit

Permalink
Merge branch 'master' into visRiktigDekoratorForInnloggetPart
Browse files Browse the repository at this point in the history
  • Loading branch information
Millad committed Mar 11, 2024
2 parents 037489c + cc7010c commit 812da82
Show file tree
Hide file tree
Showing 5 changed files with 223 additions and 187 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120

[*.yml]
indent_size = 2

[*.yaml]
indent_size = 2
34 changes: 34 additions & 0 deletions .github/workflows/bygg-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Bygg branch

on:
push:
branches:
- '**'
- '!master'

jobs:
build:
name: Bygg branch
runs-on: ubuntu-latest
steps:
- name: Sjekk ut kode
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v3
with:
registry-url: 'https://npm.pkg.github.com'
- name: Install
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Server install
working-directory: ./server
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Typescript
run: npm run ts
- name: Prettier
run: npm run prettier
- name: Kjør tester
run: npm run test
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
name: Bygg og deploy dev
name: Bygg og deploy branch

on:
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
IMAGE: ghcr.io/${{ github.repository }}/tiltaksgjennomforing:${{ github.sha }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
on: workflow_dispatch

jobs:
bygg:
build:
name: Bygg
permissions:
packages: write
name: Bygg og deploy
runs-on: ubuntu-20.04
contents: read
id-token: write
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
runs-on: ubuntu-latest
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -47,56 +43,64 @@ jobs:
- name: Remove source maps
run: |
rm dist/client/assets/*.map
- name: Bygg, tag og push Docker-image
run: |
echo ${GITHUB_TOKEN} | docker login ghcr.io -u ${GITHUB_REPOSITORY} --password-stdin
docker build --tag ${IMAGE} .
docker push ${IMAGE}
- name: Push docker image to GAR
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: arbeidsgiver
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}

deploy-dev-gcp-intern:
name: Deploy til dev-gcp intern
runs-on: ubuntu-20.04
needs: bygg
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Deploy til dev-gcp intern
uses: nais/deploy/actions/deploy@v1
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/nais-gcp-intern.yaml
PRINT_PAYLOAD: true
VARS: nais/dev-gcp-intern.yaml

VAR: image=${{ needs.build.outputs.image }}

deploy-dev-gcp-ekstern:
name: Deploy til dev-gcp ekstern
runs-on: ubuntu-20.04
needs: bygg
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Deploy til dev-gcp ekstern
uses: nais/deploy/actions/deploy@v1
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/nais-gcp-ekstern.yaml
PRINT_PAYLOAD: true
VARS: nais/dev-gcp-ekstern.yaml

VAR: image=${{ needs.build.outputs.image }}

deploy-dev-gcp-labs:
name: Deploy til dev-gcp (labs)
runs-on: ubuntu-20.04
needs: bygg
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
id-token: write
steps:
- name: Sjekk ut kode
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v1
uses: nais/deploy/actions/deploy@v2
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: nais/dev-gcp-labs.yaml
PRINT_PAYLOAD: true
VARS: nais/dev-gcp-labs.json
VAR: image=${{ needs.build.outputs.image }}
Loading

0 comments on commit 812da82

Please sign in to comment.