Skip to content

Build, push, and deploy app to dev #1401

Build, push, and deploy app to dev

Build, push, and deploy app to dev #1401

name: Build, push, and deploy app to dev
on: [workflow_dispatch]
permissions:
id-token: write
contents: read
jobs:
build:
name: Build and push Docker container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: yarn
registry-url: 'https://npm.pkg.github.com'
- name: Yarn install
run: yarn --prefer-offline --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Yarn test
run: yarn test
- name: Yarn build
run: yarn build
- name: Prune dev dependencies
run: yarn --prod --prefer-offline --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Push docker image to GAR and sign image
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: teamfamilie
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
deploy:
name: Deploy to dev
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: build_n_deploy/naiserator/dev.yaml
IMAGE: ${{ needs.build.outputs.image }}