diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml new file mode 100644 index 0000000..fdc13b6 --- /dev/null +++ b/.github/workflows/deploy-production.yaml @@ -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 }} diff --git a/kubernetes/base/kustomization.yaml b/kubernetes/base/kustomization.yaml index a34b0f4..79959d1 100644 --- a/kubernetes/base/kustomization.yaml +++ b/kubernetes/base/kustomization.yaml @@ -1,7 +1,9 @@ --- apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization + namespace: dit-docs +namePrefix: dsm-client- commonLabels: app: dsm-client diff --git a/kubernetes/development/kustomization.yaml b/kubernetes/development/kustomization.yaml index 3239f15..ec6848e 100644 --- a/kubernetes/development/kustomization.yaml +++ b/kubernetes/development/kustomization.yaml @@ -2,9 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: dit-docs -namePrefix: dsm-client- - resources: - ../base diff --git a/kubernetes/production/kustomization.yaml b/kubernetes/production/kustomization.yaml new file mode 100644 index 0000000..ec6848e --- /dev/null +++ b/kubernetes/production/kustomization.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ../base + +patches: + - path: patches/ingress-host.yaml + target: + kind: Ingress diff --git a/kubernetes/production/patches/ingress-host.yaml b/kubernetes/production/patches/ingress-host.yaml new file mode 100644 index 0000000..3837674 --- /dev/null +++ b/kubernetes/production/patches/ingress-host.yaml @@ -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