.github/workflows/gh-cli-deploy.yaml #132
Workflow file for this run
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
on: | |
workflow_dispatch: | |
inputs: | |
cluster: | |
description: 'Det clusteret branchen skal deployes til' | |
required: true | |
type: string | |
jobs: | |
run-tests: | |
name: Run tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: gradle tests | |
run: | | |
./gradlew test | |
build: | |
name: Build and push Docker container | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
outputs: | |
image: ${{ steps.docker-build-push.outputs.image }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Push docker image to GAR | |
uses: nais/docker-build-push@v0 | |
id: docker-build-push | |
with: | |
team: a11y-statement | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} # Provided as Organization Secret | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} # Provided as Organization Variable | |
deploy-dev: | |
name: Deploy to NAIS | |
needs: | |
- build | |
- run-tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: ${{ inputs.cluster }} | |
RESOURCE: ./nais/nais-dev.yaml | |
VAR: image=${{ needs.build.outputs.image }} |