From 21d8b4836f58ca8d145e5eb0532f64650d5855ba Mon Sep 17 00:00:00 2001 From: Jon Ole Hagemo Date: Mon, 13 Jan 2025 21:03:33 +0100 Subject: [PATCH 1/2] Create deploy action --- .github/workflows/on_deploy.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/on_deploy.yml diff --git a/.github/workflows/on_deploy.yml b/.github/workflows/on_deploy.yml new file mode 100644 index 000000000..e6dcbb24c --- /dev/null +++ b/.github/workflows/on_deploy.yml @@ -0,0 +1,31 @@ +name: Build and deploy +on: + workflow_dispatch: + + push: + branches: + - main +jobs: + build_and_deploy: + name: Build, push and deploy + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Build and push image and SBOM to OCI registry + uses: nais/docker-build-push@v0 + id: docker-build-push + with: + team: ${{ vars.NAIS_TEAM }} + identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} + project_id: ${{ secrets.NAIS_MANAGEMENT_PROJECT_ID }} + - name: Deploy to Nais + uses: nais/deploy/actions/deploy@v2 + env: + CLUSTER: test + RESOURCE: .nais/test.yaml + VAR: image=${{ steps.docker-build-push.outputs.image }} + TELEMETRY: ${{ steps.docker-build-push.outputs.telemetry }} + DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443 \ No newline at end of file From ada574cd44bab8e2d69461b9a65a05332b73eeff Mon Sep 17 00:00:00 2001 From: Jon Ole Hagemo Date: Mon, 13 Jan 2025 21:04:11 +0100 Subject: [PATCH 2/2] Create nais application description --- .nais/test.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .nais/test.yaml diff --git a/.nais/test.yaml b/.nais/test.yaml new file mode 100644 index 000000000..7ff042f9e --- /dev/null +++ b/.nais/test.yaml @@ -0,0 +1,17 @@ +apiVersion: nais.io/v1alpha1 +kind: Application +metadata: + name: kontrollprogram + namespace: kostra +spec: + ingresses: + - https://kostra-kontrollprogram.test.ssb.no + image: {{image}} + port: 8080 + replicas: + max: 1 + min: 1 + resources: + requests: + cpu: 50m + memory: 160Mi \ No newline at end of file