Add production deployment
This commit is contained in:
parent
0d6b1b8061
commit
ac4dc9ef40
52
.github/workflows/deploy-production.yaml
vendored
Normal file
52
.github/workflows/deploy-production.yaml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
name: Deploy To Production
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- "README.md"
|
||||
- ".vscode/**"
|
||||
|
||||
concurrency:
|
||||
group: deploy-production
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
name: Setup
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
IMAGE: "reg.dev.krd/dit-docs/dsm-client:${{ github.ref_name }}"
|
||||
steps:
|
||||
- name: Extract image name
|
||||
run: echo "Using image name $IMAGE"
|
||||
outputs:
|
||||
image: ${{ env.IMAGE }}
|
||||
image-sha: ${{ env.IMAGE }}-${{ github.sha }}
|
||||
|
||||
test:
|
||||
uses: ditkrg/dit-digital-service-manual/.github/workflows/tests-base.yaml@main
|
||||
|
||||
build:
|
||||
uses: ditkrg/common-github-workflows/.github/workflows/build-push-image.yaml@main
|
||||
needs: [setup, test]
|
||||
with:
|
||||
tags: |-
|
||||
${{ needs.setup.outputs.image }}
|
||||
${{ needs.setup.outputs.image-sha }}
|
||||
cache-from: type=registry,ref=${{ needs.setup.outputs.image }}
|
||||
secrets:
|
||||
username: ${{ secrets.HARBOR_USER }}
|
||||
password: ${{ secrets.HARBOR_TOKEN }}
|
||||
|
||||
deploy:
|
||||
uses: ditkrg/dit-digital-service-manual/.github/workflows/deploy-base.yaml@main
|
||||
needs: [setup, build]
|
||||
with:
|
||||
image: ${{ needs.setup.outputs.image-sha }}
|
||||
env_url: https://docs.digital.gov.krd
|
||||
env_name: production
|
||||
|
||||
secrets:
|
||||
KUBECONFIG: ${{ secrets.KUBECONFIG }}
|
||||
@ -1,7 +1,9 @@
|
||||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: dit-docs
|
||||
namePrefix: dsm-client-
|
||||
|
||||
commonLabels:
|
||||
app: dsm-client
|
||||
|
||||
@ -2,9 +2,6 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: dit-docs
|
||||
namePrefix: dsm-client-
|
||||
|
||||
resources:
|
||||
- ../base
|
||||
|
||||
|
||||
11
kubernetes/production/kustomization.yaml
Normal file
11
kubernetes/production/kustomization.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../base
|
||||
|
||||
patches:
|
||||
- path: patches/ingress-host.yaml
|
||||
target:
|
||||
kind: Ingress
|
||||
9
kubernetes/production/patches/ingress-host.yaml
Normal file
9
kubernetes/production/patches/ingress-host.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
- op: add
|
||||
path: /spec/rules/0/host
|
||||
value: docs.digital.gov.krd
|
||||
- op: add
|
||||
path: /spec/tls
|
||||
value:
|
||||
- hosts:
|
||||
- docs.digital.gov.krd
|
||||
secretName: ingress-cert-dit-docs-dsm-client
|
||||
Loading…
Reference in New Issue
Block a user