This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
endret navn #1
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
name: Build og deploy til dev-gcp | |
on: | |
push: | |
branches: | |
- 'deploy/**' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
IMAGE_BASE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/aap/${{ github.event.repository.name }} | |
jobs: | |
bygg: | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
outputs: | |
image: ${{ steps.kompiler-pr.outputs.image }} | |
steps: | |
- name: Print number of PR | |
run: echo The Title of your PR is ${{ github.event.pull_request.number }} | |
- name: Sjekk ut kode | |
uses: actions/[email protected] | |
- name: Setter opp Java 17 | |
uses: actions/[email protected] | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: maven | |
- name: Setter tag-navn | |
run: echo "TAG=$(date +%Y.%m.%d.%H%M%S)-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV | |
- name: Setter image-navn | |
run: echo "IMAGE=$(echo $IMAGE_BASE):$(echo $TAG)-PR${{ steps.kompiler-pr.outputs.image }}" >> $GITHUB_ENV | |
- name: Login GAR | |
uses: nais/login@v0 | |
with: | |
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | |
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | |
team: aap | |
- name: Kompiler | |
id: kompiler-pr | |
run: | | |
echo "image=${{ env.IMAGE }}" >> $GITHUB_OUTPUT | |
./mvnw --batch-mode --settings .github/.m2/settings.xml -DGAR_TOKEN=${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} package jib:build | |
deploy: | |
name: Deploy til dev-gcp | |
needs: bygg | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
environment: dev-gcp:aap | |
env: | |
PRINT_PAYLOAD: true | |
APIKEY: ${{secrets.NAIS_DEPLOY_APIKEY}} | |
RESOURCE: .nais/naiserator.yaml,.nais/dev-gcp-alerts.yaml | |
CLUSTER: dev-gcp | |
VARS: .nais/$dev-gcp.json | |
IMAGE: ${{needs.bygg.outputs.image}} | |
steps: | |
- uses: actions/[email protected] | |
- uses: nais/deploy/actions/deploy@master | |