Skip to content

Deploy feature branch #21

Deploy feature branch

Deploy feature branch #21

name: Deploy feature branch
on:
workflow_dispatch:
concurrency:
group: deploy_feature_branch
cancel-in-progress: true
permissions:
contents: read
id-token: write
jobs:
test-build-push:
name: Test, build and push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: 'maven'
- name: 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-dev:
name: Deploy to dev
needs: [test-build-push]
uses: ./.github/workflows/naisdeploy.yaml
with:
environment: dev
VAR: image=${{ needs.test-build-push.outputs.image }}
TELEMETRY: ${{ needs.test-build-push.outputs.telemetry }}
secrets:
nais-deploy-secret: ${{ secrets.NAIS_DEPLOY_APIKEY }}
github-token: ${{ secrets.GITHUB_TOKEN }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}