Skip to content

Gå over fra Create-react-app til Vite (#8) #152

Gå over fra Create-react-app til Vite (#8)

Gå over fra Create-react-app til Vite (#8) #152

Workflow file for this run

name: Build and deploy
on:
push:
branches:
- main
- 'dev/**'
env:
ORG_GRADLE_PROJECT_githubPassword: ${{ secrets.GITHUB_TOKEN }}
jobs:
build_and_deploy:
name: Build, push and deploy
runs-on: ubuntu-latest
env:
VITE_REACT_APP_BASE_URL: ${{ secrets.REACT_APP_BASE_URL }}
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com'
- uses: actions/checkout@v4
- name: Install frontend dependencies
run: npm install
working-directory: ./lps-client-frontend-v
- name: Build frontend
run: npm run build
working-directory: ./lps-client-frontend-v
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
- name: Test and build backend
run: ./gradlew clean build
working-directory: ./lps-client-backend
- name: Push docker image to GAR
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: helsearbeidsgiver
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
dockerfile: ./lps-client-backend/Dockerfile
docker_context: ./lps-client-backend
- name: Deploy to NAIS
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/app.yaml
VAR: image=${{ steps.docker-build-push.outputs.image }}