Deploy feature branch minside-varsler by @tu55eladd #85
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 to dev gcp | |
run-name: Deploy feature branch ${{ github.ref_name }} by @${{ github.actor }} | |
on: | |
workflow_dispatch: | |
env: | |
PRINT_PAYLOAD: true | |
concurrency: | |
group: deploy_feature_branch | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Veilarbdialog - Test, build, push | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 21 | |
distribution: 'temurin' | |
cache: 'maven' | |
- name: Veilarbdialog - Build maven artifacts | |
run: mvn -B package | |
- name: Push docker image to GAR | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: dab | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} # Provided as Organization Secret | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} # Provided as Organization Variable | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
telemetry: ${{ steps.docker-build-push.outputs.telemetry }} | |
deploy: | |
name: Veilarbdialog - deploy to dev | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Veilarbdialog - Deploy application to dev | |
uses: nais/deploy/actions/deploy@v2 | |
env: | |
CLUSTER: dev-gcp | |
RESOURCE: nais/nais-dev-gcp.yaml | |
VAR: image=${{ needs.build.outputs.image }} | |
TELEMETRY: ${{ needs.build.outputs.telemetry }} |