Map locationList og fjern Location fra stilling #299
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, workflow_dispatch] | |
permissions: | |
contents: read | |
id-token: write | |
jobs: | |
bygg-og-push-docker-image: | |
name: Bygg applikasjon | |
runs-on: ubuntu-latest | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
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: Push docker image to GAR | |
if: github.actor != 'dependabot[bot]' | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: toi | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
deploy-til-dev: | |
name: Deploy til dev | |
needs: bygg-og-push-docker-image | |
if: github.event_name == 'workflow_dispatch' || 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@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: nais-dev.yaml | |
VAR: image=${{ needs.bygg-og-push-docker-image.outputs.image }} | |
deploy-to-prod: | |
name: Deploy til prod | |
needs: [bygg-og-push-docker-image, deploy-til-dev] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: prod-gcp | |
RESOURCE: nais-prod.yaml | |
VAR: image=${{ needs.bygg-og-push-docker-image.outputs.image }} |