Deploy veilederapplication to dev #60
Workflow file for this run
This file contains hidden or 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: Deploy veilederapplication to dev | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- '*-veilder-dev' | |
env: | |
APP_NAME: ungdomsytelse-veileder | |
jobs: | |
deploy-to-dev: | |
name: Deploy veilederapp to dev (${{github.ref_name}}) | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # required: nais/docker-build-push | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .yarnrc.yml | |
run: | | |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com" | |
yarn config set npmScopes.navikt.npmAlwaysAuth true | |
yarn config set npmScopes.navikt.npmAuthToken $NODE_AUTH_TOKEN | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'yarn' | |
- run: yarn set version 4.x | |
- name: Install dependencies (yarn) | |
run: yarn install | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
- name: Build application | |
run: yarn turbo run build --filter=@navikt/${{ env.APP_NAME }} | |
- name: Build and publish docker image | |
uses: nais/docker-build-push@v0 | |
id: docker-push | |
with: | |
team: dusseldorf | |
push_image: true | |
pull: true | |
dockerfile: apps/${{env.APP_NAME}}/Dockerfile | |
docker_context: . | |
image_suffix: ${{env.APP_NAME}}-mono | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: Deploy to dev | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: apps/${{ env.APP_NAME }}/nais/nais.yml | |
VARS: apps/${{ env.APP_NAME }}/nais/dev-gcp.json | |
VAR: GITHUB_REF_NAME=${{ github.ref_name }} # brukes i applikasjonerna | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
IMAGE: ${{ steps.docker-push.outputs.image }} | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} |