🐛 Feilmeldinger i modal blir ikke resatt #951
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: Build and deploy aap-soknad to labs | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '**.md' | |
env: | |
IMAGE_BASE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/aap/${{ github.event.repository.name }} | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
outputs: | |
image: ${{ steps.image.outputs.image }} | |
permissions: | |
contents: read | |
id-token: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://npm.pkg.github.com | |
cache: yarn | |
- name: Cache client node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }} | |
- name: install dependencies Yarn | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- name: Copy env-file for labs | |
run: cp .nais/labs.env .env.local | |
- name: client tests | |
run: yarn test | |
- name: Bygg klient(yarn run build) | |
run: yarn run build | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Setter tag-navn | |
run: echo "TAG=$(date +%Y.%m.%d.%H%M%S)-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV | |
- name: Setter image-navn | |
id: image | |
run: | | |
echo "IMAGE=$(echo $IMAGE_BASE)-$(echo $TAG)" >> $GITHUB_ENV | |
echo "image=$(echo $IMAGE_BASE)-$(echo $TAG)" >> $GITHUB_OUTPUT | |
- name: Login GAR | |
uses: nais/login@v0 | |
with: | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
team: aap | |
- name: Build and push Docker | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
file: DockerfileLabs | |
tags: ${{ env.IMAGE }} | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
deployAppToLabs: | |
name: Deploy app to labs | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Deploy to LABS | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
IMAGE: ${{needs.build.outputs.image}} | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: .nais/labs-gcp.yaml |