Fiks mock-id og legg på stillingskategori i mock-data #247
Workflow file for this run
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: Bygg og deploy | |
on: [push] | |
env: | |
IMAGE: ghcr.io/${{ github.repository }}/vis-stilling:${{ github.sha }} | |
permissions: | |
packages: write | |
jobs: | |
bygg-og-push-docker-image: | |
name: Bygg applikasjon | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: 'https://npm.pkg.github.com' | |
cache: 'npm' | |
cache-dependency-path: | | |
package-lock.json | |
server/package-lock.json | |
- name: Installer avhengigheter | |
run: npm ci | |
- name: Bygg applikasjon | |
run: npm run build | |
- name: Installer avhengigheter for server | |
run: npm run server:install | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- name: Bygg server | |
run: npm run server:build | |
- name: Logg inn til Github | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Bygg og publiser Docker-image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.IMAGE }} | |
deploy-til-dev: | |
name: Deploy til dev | |
needs: bygg-og-push-docker-image | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/oppgrader-dekoratør' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: nais-dev.yaml | |
deploy-to-prod: | |
name: Deploy til prod | |
needs: deploy-til-dev | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: nais-prod.yaml |