Skip to content

Skriver om xp-archive deploy til reusable workflow #1

Skriver om xp-archive deploy til reusable workflow

Skriver om xp-archive deploy til reusable workflow #1

name: Build and deploy XP archive
on:
workflow_call:
inputs:
naisEnv:
required: true
type: string
VITE_APP_ORIGIN:
required: true
type: string
XP_ORIGIN:
required: true
type: string
HTML_RENDER_API:
required: true
type: string
secrets:
READER_TOKEN:
required: true
NAIS_WORKLOAD_IDENTITY_PROVIDER:
required: true
#on:
# workflow_dispatch:
# push:
# branches:
# - master
# paths:
# - package*.json
# - xp-archive/**/*
# - common/**/*
jobs:
build-and-deploy:
name: Build and deploy
runs-on: ubuntu-latest
permissions:
contents: "read"
id-token: "write"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://npm.pkg.github.com'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: npm ci --include-workspace-root --workspace=common --workspace=xp-archive
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Set env vars
working-directory: xp-archive
run: |
cat > .env <<EOF
NODE_ENV=production
APP_PORT=3499
APP_BASEPATH=/xp
VITE_APP_ORIGIN={{ inputs.VITE_APP_ORIGIN }}
XP_ORIGIN={{ inputs.XP_ORIGIN }}
HTML_RENDER_API={{ inputs.HTML_RENDER_API }}
EOF
- name: Build application
run: npm run build
working-directory: xp-archive
- name: Build and push docker image
uses: nais/docker-build-push@v0
id: docker-push
with:
team: personbruker
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
dockerfile: Dockerfile_xp
- name: Deploy application
uses: nais/deploy/actions/deploy@v2
env:

Check failure on line 77 in .github/workflows/.xp-archive-deploy.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/.xp-archive-deploy.yml

Invalid workflow file

You have an error in your yaml syntax on line 77
CLUSTER: {{ inputs.naisEnv }}-gcp
RESOURCE: xp-archive/.nais/config.yml
VAR: image=${{ steps.docker-push.outputs.image }}
VARS: xp-archive/.nais/vars/{{ inputs.naisEnv }}.yml