Skip to content

Commit a20f52a

Browse files
authored
Add workflow for feature branch deployement to gcp (#1692)
1 parent 1cb0b9e commit a20f52a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy til Dev
2+
on:
3+
workflow_dispatch:
4+
env:
5+
IMAGE_TAG: ${{ github.sha }}
6+
IMAGE: ghcr.io/${{ github.repository }}/veilarbportefolje
7+
PRINT_PAYLOAD: true
8+
permissions:
9+
packages: write
10+
contents: write
11+
id-token: write
12+
jobs:
13+
build-and-push:
14+
name: Build and push
15+
runs-on: ubuntu-latest
16+
outputs:
17+
image: ${{ steps.docker-build-push.outputs.image }}
18+
permissions:
19+
id-token: write
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Java
25+
uses: actions/setup-java@v4
26+
with:
27+
java-version: 21
28+
distribution: 'temurin'
29+
cache: 'maven'
30+
31+
- name: Build maven artifacts
32+
run: mvn -Dgithub.token=${{ secrets.GITHUB_TOKEN }} -B package -D skipTests
33+
34+
- name: Build and push Docker image
35+
uses: nais/docker-build-push@v0
36+
id: docker-build-push
37+
with:
38+
team: obo
39+
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
40+
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
41+
42+
deploy-dev:
43+
name: Deploy application to dev
44+
needs: build-and-push
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Checkout
48+
uses: actions/checkout@v4
49+
50+
- name: Deploy application
51+
uses: nais/deploy/actions/deploy@v2
52+
env:
53+
CLUSTER: dev-gcp
54+
RESOURCE: .nais/application/gcp/application-config-dev.yaml
55+
VAR: image=${{ needs.build-and-push.outputs.image }}

0 commit comments

Comments
 (0)