Bump vite from 5.4.11 to 6.0.4 #1686
Workflow file for this run
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 | |
on: | |
push: | |
env: | |
IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }} | |
LATEST_IMAGE: ghcr.io/${{ github.repository }}:latest | |
jobs: | |
build: | |
name: Bygg | |
runs-on: ubuntu-latest | |
permissions: | |
contents: "read" | |
id-token: "write" | |
packages: "write" | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22.x" | |
- name: Bygg og push Docker image | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: teamdagpenger | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
tag: ${{ env.VERSION_TAG }} | |
build_secrets: NODE_AUTH_TOKEN=${{ secrets.READER_TOKEN }} | |
push_image: true | |
dockerfile: Dockerfile | |
docker_context: . | |
- name: Build static files | |
uses: docker/build-push-action@v6 | |
with: | |
target: build-export | |
outputs: type=local,dest=build | |
secrets: NODE_AUTH_TOKEN=${{ secrets.READER_TOKEN }} | |
- name: Upload static files | |
uses: nais/deploy/actions/cdn-upload/v2@master | |
with: | |
team: teamdagpenger | |
source: ./build/client | |
destination: "/dp-saksbehandling-frontend/" | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
playwright: | |
timeout-minutes: 2 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
id: node_modules | |
with: | |
path: ./node_modules | |
key: modules-${{ hashFiles('package-lock.json') }} | |
- uses: actions/setup-node@v4 | |
if: steps.node_modules.outputs.cache-hit != 'true' | |
with: | |
node-version: "22.x" | |
cache: "npm" | |
registry-url: "https://npm.pkg.github.com" | |
- name: "Install dependencies" | |
run: npm ci --ignore-scripts | |
if: steps.node_modules.outputs.cache-hit != 'true' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- name: Store Playwright's Version | |
run: | | |
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//') | |
echo "Playwright's Version: $PLAYWRIGHT_VERSION" | |
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV | |
- name: Cache Chromium browser for Playwright's Version | |
id: cache-chromium-browser | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/ms-playwright | |
key: chromium-with-playwright-version-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Chromium browser | |
if: steps.cache-chromium-browser.outputs.cache-hit != 'true' | |
run: npx playwright install chromium --with-deps | |
- name: Run Playwright Tests | |
run: npm run playwright:verbose | |
- name: Store Artifacts from Failed Tests | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: test-results/ | |
retention-days: 7 | |
deploy-dev: | |
name: Deploy til dev-gcp | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
environment: | |
name: Development | |
url: "https://dagpenger.ansatt.dev.nav.no/saksbehandling" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
VAR: image=${{ needs.build.outputs.image }},githubSha=${{ github.sha }} | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/nais.yaml,.nais/unleash-apitoken.yaml | |
VARS: .nais/vars-dev.yaml | |
PRINT_PAYLOAD: true | |
deploy-prod: | |
name: Deploy til prod-gcp | |
if: github.ref == 'refs/heads/main' | |
needs: [ build, deploy-dev ] | |
runs-on: ubuntu-latest | |
environment: | |
name: Production | |
url: "https://dagpenger.ansatt.nav.no/saksbehandling" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
VAR: image=${{ needs.build.outputs.image }},githubSha=${{ github.sha }} | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: .nais/nais.yaml,.nais/unleash-apitoken.yaml | |
VARS: .nais/vars-prod.yaml | |
PRINT_PAYLOAD: true | |