Skip to content

Deploy feature branch gcp-main-2 by @tu55eladd #64

Deploy feature branch gcp-main-2 by @tu55eladd

Deploy feature branch gcp-main-2 by @tu55eladd #64

name: Deploy feature branch GCP
run-name: Deploy feature branch ${{ github.ref_name }} by @${{ github.actor }}
on:
workflow_dispatch:
push:
branches:
- gcp-main-2
permissions:
packages: write
contents: write
concurrency:
group: deploy_feature_branch_gcp
cancel-in-progress: true
env:
IMAGE_TAG: ${{ github.sha }}-dev-only
IMAGE: ghcr.io/${{ github.repository }}/veilarbaktivitet
PRINT_PAYLOAD: true
jobs:
build_and_deploy:
name: Build, push and deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- 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 }}
- name: Deploy to NAIS
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
APIKEY: ${{ secrets.DAB_NAIS_DEPLOY_APIKEY }}
RESOURCE: nais/nais-dev-gcp.yaml
VAR: version=${{ env.IMAGE_TAG }}