Skip to content

Matcher enum med backend #150

Matcher enum med backend

Matcher enum med backend #150

Workflow file for this run

name: Bygg, deploy til dev-gcp og lag release
on:
push:
paths-ignore:
- '**.md'
- '.gitignore'
- 'LICENCE'
- 'CODEOWNERS'
branches:
- main
- depfix
jobs:
test:
name: Kjør Cypress-tester
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Sjekk ut koden
uses: actions/checkout@v4
- name: Autentiser med GitHub NPM registry
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.READER_TOKEN }}" >> ~/.npmrc
echo "@navikt:registry=https://npm.pkg.github.com" >> ~/.npmrc
- name: Kjør Cypress
uses: cypress-io/github-action@v6
with:
start: npm run dev
wait-on: 'http://ip6-localhost:3001'
working-directory: client
config-file: cypress.config.js
record: false
- name: Last opp artefakt
uses: actions/upload-artifact@v4
with:
name: cypress-test
path: cypress/screenshots/
build:
name: Bygg
permissions:
packages: write
contents: write
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
docker_image: ${{ steps.docker-build-push.outputs.image }}
version_tag: ${{ steps.version-tag.outputs.VERSION_TAG}}
steps:
- name: Sjekk ut koden
uses: actions/checkout@v4
- name: Før deploy
uses: navikt/digihot-deploy/actions/pre-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Bygg og push Docker image
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: teamdigihot
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 }}
- name: Definer release tag
id: version-tag
run: echo "VERSION_TAG=${{env.VERSION_TAG}}" >> "$GITHUB_OUTPUT"
deploy-labs:
name: Deploy til labs-gcp
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: write
id-token: write
timeout-minutes: 15
steps:
- name: Sjekk ut koden
uses: actions/checkout@v4
- name: Deploy
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/labs.yaml
IMAGE: ${{ needs.build.outputs.docker_image }}
deploy-dev:
name: Deploy til dev-gcp
runs-on: ubuntu-latest
needs: [build]
permissions:
contents: write
id-token: write
timeout-minutes: 15
env:
VERSION_TAG: ${{ needs.build.outputs.version_tag }}
steps:
- name: Sjekk ut koden
uses: actions/checkout@v4
- name: Deploy
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/dev.yaml
IMAGE: ${{ needs.build.outputs.docker_image }}
- name: Etter deploy
if: github.ref == 'refs/heads/main'
uses: navikt/digihot-deploy/actions/post-deploy@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Lag release
if: github.ref == 'refs/heads/main'
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION_TAG }}
release_name: ${{ env.APPLICATION }} ${{ env.VERSION_TAG }}
body: ${{ env.CHANGE_LOG }}
draft: true
prerelease: false