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 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