Skip to content

Commit

Permalink
Add workflow for feature branch deployement to gcp (#1692)
Browse files Browse the repository at this point in the history
  • Loading branch information
dragutin-nav authored Sep 2, 2024
1 parent 1cb0b9e commit a20f52a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-deploy-feature-branch-dev-gcp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Deploy til Dev
on:
workflow_dispatch:
env:
IMAGE_TAG: ${{ github.sha }}
IMAGE: ghcr.io/${{ github.repository }}/veilarbportefolje
PRINT_PAYLOAD: true
permissions:
packages: write
contents: write
id-token: write
jobs:
build-and-push:
name: Build and push
runs-on: ubuntu-latest
outputs:
image: ${{ steps.docker-build-push.outputs.image }}
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Build maven artifacts
run: mvn -Dgithub.token=${{ secrets.GITHUB_TOKEN }} -B package -D skipTests

- name: Build and push Docker image
uses: nais/docker-build-push@v0
id: docker-build-push
with:
team: obo
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}

deploy-dev:
name: Deploy application to dev
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Deploy application
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-gcp
RESOURCE: .nais/application/gcp/application-config-dev.yaml
VAR: image=${{ needs.build-and-push.outputs.image }}

0 comments on commit a20f52a

Please sign in to comment.