This repository has been archived on 2024-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
helse-sprik/.github/workflows/build-and-deploy.yml
sindrekjelsrud f296f7c5c6 deploy test #5 ("guaranteed to work" - Nordahl)
Co-authored-by: Amalie Erdal Mansaker <amalie.erdal.mansaker@nav.no>
2023-06-28 16:41:37 +02:00

48 lines
No EOL
1.2 KiB
YAML

name: "Build and deploy app"
on:
workflow_dispatch:
push:
branches:
- "main"
env:
"IMAGE": "ghcr.io/${{ github.repository }}:${{ github.sha }}"
defaults:
run:
working-directory: frontend
jobs:
"build":
name: "build"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- uses: "actions/setup-node@v3"
with:
node-version: "18"
- name: "Install dependencies"
run: "yarn"
- name: "Build app"
run: "yarn run build"
- name: "Login to GitHub Docker Registry"
uses: "docker/login-action@v1"
with:
"registry": "ghcr.io"
"username": "${{ github.actor }}"
"password": "${{ secrets.GITHUB_TOKEN }}"
- name: "Build and push Docker"
uses: "docker/build-push-action@v2"
with:
context: frontend
tags: "${{ env.IMAGE }}"
push: "true"
"deploy":
name: "Deploy app"
needs: "build"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v3"
- name: "Deploy app"
uses: "nais/deploy/actions/deploy@v1"
env:
"APIKEY": "${{ secrets.NAIS_DEPLOY_APIKEY }}"
"CLUSTER": "dev-gcp"
"RESOURCE": "nais.yml"