This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lagt til workflow dispatch, slettet unødvendig deploy-branch.yml
Co-authored-by: Vetle Hollund <[email protected]> Co-authored-by: Richard Borge <[email protected]> Co-authored-by: Robin Tordly<[email protected]>
- Loading branch information
1 parent
c6ea741
commit c52a91b
Showing
2 changed files
with
33 additions
and
88 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -2,12 +2,21 @@ name: Bygg og deploy | |
|
||
on: | ||
workflow_dispatch: | ||
|
||
inputs: | ||
cluster: | ||
description: 'Cluster å deploye til' | ||
required: true | ||
default: 'dev-gcp' | ||
type: choice | ||
options: | ||
- 'dev-gcp' | ||
- 'prod-gcp' | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
- '.github/workflows/**.yml' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
IMAGE: europe-north1-docker.pkg.dev/${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}/aap/${{ github.event.repository.name }} | ||
|
@@ -31,14 +40,6 @@ jobs: | |
distribution: temurin | ||
cache: maven | ||
|
||
# - name: Installerer cosign | ||
# uses: sigstore/[email protected] | ||
# with: | ||
# cosign-release: 'v1.3.1' | ||
|
||
# - name: Verifiserer distroless base-image | ||
# run: cosign verify --key distroless.pub gcr.io/distroless/Java17 | ||
|
||
- name: Setter tag-navn | ||
run: echo "TAG=$(date +%Y.%m.%d.%H%M%S)-$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV | ||
|
||
|
@@ -67,22 +68,36 @@ jobs: | |
sbom: target/bom.json | ||
image_ref: ${{ env.IMAGE }}@${{ env.DIGEST }} | ||
|
||
deploy: | ||
strategy: | ||
matrix: | ||
cluster: [ dev-gcp, prod-gcp ] | ||
name: Deploy til ${{matrix.cluster}} | ||
deploy_dev_gcp: | ||
if: github.event.inputs.cluster == 'dev-gcp' || github.event_name == 'push' | ||
needs: bygg | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
environment: ${{matrix.cluster}}:aap | ||
environment: dev-gcp:aap | ||
env: | ||
PRINT_PAYLOAD: true | ||
APIKEY: ${{secrets.NAIS_DEPLOY_APIKEY}} | ||
RESOURCE: .nais/naiserator.yaml,.nais/${{matrix.cluster}}-alerts.yaml | ||
CLUSTER: ${{matrix.cluster}} | ||
VARS: .nais/${{matrix.cluster}}.json | ||
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 | ||
|
||
deploy_prod_gcp: | ||
if: github.event.inputs.cluster == 'prod-gcp' || github.event_name == 'push' | ||
needs: bygg | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
environment: prod-gcp:aap | ||
env: | ||
PRINT_PAYLOAD: true | ||
APIKEY: ${{secrets.NAIS_DEPLOY_APIKEY}} | ||
RESOURCE: .nais/naiserator.yaml,.nais/prod-gcp-alerts.yaml | ||
CLUSTER: prod-gcp | ||
VARS: .nais/prod-gcp.json | ||
IMAGE: ${{needs.bygg.outputs.image}} | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: nais/deploy/actions/deploy@master |
This file was deleted.
Oops, something went wrong.