Skip to content

Deploy feature branch tilgangskontrol-og-auditlogging by @hakonph #61

Deploy feature branch tilgangskontrol-og-auditlogging by @hakonph

Deploy feature branch tilgangskontrol-og-auditlogging by @hakonph #61

name: Deploy feature branch
run-name: Deploy feature branch ${{ github.ref_name }} by @${{ github.actor }}
on:
workflow_dispatch:
permissions:
packages: write
contents: write
concurrency:
group: deploy_feture_branch
cancel-in-progress: true
env:
IMAGE_TAG: ${{ github.sha }}-dev-only
IMAGE: ghcr.io/${{ github.repository }}/veilarbaktivitet
PRINT_PAYLOAD: true
jobs:
test-build-and-push:
name: Test, build and push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Execute Gradle build
run: ./gradlew assemble --scan
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ env.IMAGE }}:${{ env.IMAGE_TAG }}
deploy-dev:
name: Deploy application to dev
needs: test-build-and-push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Deploy application
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-fss
RESOURCE: nais/nais-dev.yaml
VAR: version=${{ env.IMAGE_TAG }},namespace=q1