Deploy branch #46
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: Deploy branch | |
on: | |
workflow_dispatch: | |
inputs: | |
cluster: | |
description: 'Det clusteret branchen skal deployes til' | |
required: true | |
type: string | |
permissions: | |
packages: write | |
jobs: | |
build: | |
name: Bygg prosjekt og push docker-image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
steps: | |
- name: Sjekk ut prosjekt | |
uses: actions/checkout@v4 | |
- name: Sett opp java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Sett opp gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Bygg prosjekt | |
run: ./gradlew assemble | |
- name: Build og push docker-image | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: min-side | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
deploy: | |
name: Deploy til NAIS | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Sjekk ut prosjekt | |
uses: actions/checkout@v4 | |
- name: 'Deploy til ${{ inputs.cluster }}' | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: ${{ inputs.cluster }} | |
RESOURCE: ./nais/${{ inputs.cluster }}/nais.yaml | |
VAR: version=${{ needs.build.outputs.image }} |