-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for feature branch deployement to gcp (#1692)
- Loading branch information
1 parent
1cb0b9e
commit a20f52a
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
.github/workflows/build-deploy-feature-branch-dev-gcp.yaml
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
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 }} |