-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (39 loc) · 1.33 KB
/
deploy_branch_gcp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: 'Bygg og deploy branch til dev-gcp'
on:
workflow_dispatch:
jobs:
build_and_push:
permissions:
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Java'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
cache: 'gradle'
- name: 'Build code'
run: |
./gradlew build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: 'Build and push docker image'
uses: nais/docker-build-push@v0
id: docker-push
with:
team: pensjonopptjening
tag: ${{ github.sha }}-${{ github.ref_name }}
image_suffix: ${{ github.ref_name }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} # required, but is defined as an organization variable
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} # required, but is defined as an organization secret
- name: 'Deploy til dev-gcp'
uses: nais/deploy/actions/deploy@v2
env:
RESOURCE: nais/dev-gcp.yml,nais/unleash-apitoken-dev-gcp.yml
CLUSTER: dev-gcp
IMAGE: ${{ steps.docker-push.outputs.image }}
TELEMETRY: ${{ steps.docker-push.outputs.telemetry }}