Repository navigation
Merge pull request #126 from navikt/rm_foobar #33
This file contains hidden or 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: Manuell deploy dev frontend mock | |
| on: | |
| workflow_dispatch: {} | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| compile-test-and-build: | |
| name: Compile, test and build image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| env: | |
| CDN_DESTINATION: /ekspertbistand-mock/${{ github.sha }} | |
| CDN_PUBLIC_BASE: https://cdn.nav.no/fager/ekspertbistand-mock/${{ github.sha }} | |
| BASE_PATH: /ekspertbistand | |
| VITE_ENABLE_MOCKS: "true" | |
| outputs: | |
| image: ${{ steps.docker-build-push.outputs.image }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.32.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| registry-url: https://npm.pkg.github.com/ | |
| cache: pnpm | |
| - name: Install server production dependencies | |
| run: pnpm --filter ./frontend/server install --frozen-lockfile --prod | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
| - name: Run tests | |
| run: pnpm test | |
| - name: Build workspace | |
| run: pnpm run build | |
| env: | |
| VITE_BASE_PATH: ${{ env.CDN_PUBLIC_BASE }} | |
| VITE_ENABLE_MOCKS: ${{ env.VITE_ENABLE_MOCKS }} | |
| - name: Upload static assets to NAIS CDN | |
| uses: nais/deploy/actions/cdn-upload/v2@master | |
| with: | |
| team: fager | |
| source: ./frontend/client/dist | |
| destination: ${{ env.CDN_DESTINATION }} | |
| source_keep_parent_name: false | |
| - name: Login to NAIS (sets registry and OIDC) | |
| id: login | |
| uses: nais/login@v0 | |
| with: | |
| team: fager | |
| project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
| identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
| - name: Build and push image | |
| id: docker-build-push | |
| uses: nais/docker-build-push@v0 | |
| with: | |
| team: fager | |
| image_suffix: frontend-mock | |
| tag: ${{ github.sha }} | |
| docker_context: . | |
| dockerfile: Dockerfile | |
| build_args: | | |
| NODE_AUTH_TOKEN=${{ secrets.READER_TOKEN }} | |
| BASE_PATH=${{ env.BASE_PATH }} | |
| VITE_BASE_PATH=${{ env.CDN_PUBLIC_BASE }} | |
| VITE_ENABLE_MOCKS=${{ env.VITE_ENABLE_MOCKS }} | |
| salsa: true | |
| deploy-to-dev-gcp: | |
| name: Deploy to dev-gcp | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| needs: compile-test-and-build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Login to NAIS (sets registry and OIDC) | |
| uses: nais/login@v0 | |
| with: | |
| team: fager | |
| - name: Deploy dev-gcp | |
| uses: nais/deploy/actions/deploy@v2 | |
| env: | |
| CLUSTER: dev-gcp | |
| RESOURCE: nais/dev-gcp-frontend-mock.yaml | |
| PRINT_PAYLOAD: "true" | |
| VAR: image=${{ needs.compile-test-and-build.outputs.image }} | |
| REF: ${{ github.sha }} |