Nytt filtype på vite config til .mts for å få oppgradert vite-tsconfi… #146
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
name: Bygg og deploy dev | |
on: | |
push: | |
branches: | |
- dev | |
- 'preprod/**' | |
env: | |
APP: fritak-agp-frontend | |
IMAGE: ghcr.io/${{ github.repository }}/fritak-agp-frontend:${{ github.sha }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
jobs: | |
Bygg: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: 'https://npm.pkg.github.com' | |
- uses: actions/checkout@master | |
- run: yarn install --frozen-lockfile | |
- run: yarn build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: fritak-frontend-artifact | |
path: ${{ github.workspace }}/dist/**/* | |
Unit-test: | |
name: Run unit tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: 'https://npm.pkg.github.com' | |
- run: yarn install --frozen-lockfile | |
- run: yarn test | |
Eslint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: 'https://npm.pkg.github.com' | |
- run: yarn install --frozen-lockfile | |
- run: yarn lint | |
Docker: | |
needs: [Unit-test, Eslint, Bygg] | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: write # to write sarif | |
security-events: write # push sarif to github security | |
steps: | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: 'https://npm.pkg.github.com' | |
- uses: actions/checkout@master | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fritak-frontend-artifact | |
path: dist | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ env.IMAGE }} | |
secrets: | | |
"NODE_AUTH_TOKEN=${{ secrets.READER_TOKEN }}" | |
build-args: | | |
"BUILDMODE=development" | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: ${{ env.IMAGE }} | |
format: 'sarif' | |
output: 'trivy-results.sarif' | |
severity: 'HIGH,CRITICAL' | |
limit-severities-for-sarif: true | |
- name: Upload Trivy scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
Deploy: | |
needs: [Docker] | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
TEAM: helsearbeidsgiver | |
CLUSTER: dev-gcp | |
RESOURCE: naiserator.yaml | |
VARS: nais/dev-gcp.json | |
REF: ${{ env.COMMIT }} | |
IMAGE: ${{ env.IMAGE }} |