diff --git a/.github/workflows/deploy-base.yaml b/.github/workflows/deploy-base.yaml deleted file mode 100644 index 6b7744f..0000000 --- a/.github/workflows/deploy-base.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Deploy - -on: - workflow_call: - inputs: - image: - type: string - required: true - env_url: - type: string - required: true - env_name: - type: string - required: true - - secrets: - KUBECONFIG: { required: true } - -env: - NAMESPACE: dit-docs - -jobs: - deploy: - timeout-minutes: 10 - runs-on: ubuntu-20.04 - environment: - url: ${{ inputs.env_url }} - name: ${{ inputs.env_name }} - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Kubectl tool installer - uses: Azure/setup-kubectl@v3 - - - uses: azure/k8s-set-context@v3 - with: - method: kubeconfig - kubeconfig: ${{ secrets.KUBECONFIG }} - - - name: Setup Kustomize - uses: imranismail/setup-kustomize@v2 - - - name: Edit kustomization file - working-directory: kubernetes/base - run: kustomize edit set image IMAGE="${{ inputs.image }}" - - - name: Deploy - working-directory: kubernetes/${{ inputs.env_name }} - run: |- - - kustomize build | kubectl apply -f - - kubectl rollout -n "$NAMESPACE" status deployment/dsm-client-deployment -w --timeout=3m diff --git a/.github/workflows/deploy-dev.yaml b/.github/workflows/deploy-dev.yaml deleted file mode 100644 index c689c7a..0000000 --- a/.github/workflows/deploy-dev.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: Deploy To Development - -on: - push: - branches: - - dev - - paths-ignore: - - "README.md" - - ".vscode/**" - - - ".github/**" - - "!.github/workflows/tests-base.yaml" - - "!.github/workflows/deploy-base.yaml" - - "!.github/workflows/deploy-dev.yaml" - -concurrency: - group: deploy-dev - cancel-in-progress: true - -jobs: - test: - uses: ./.github/workflows/tests-base.yaml - - build: - uses: ditkrg/build-image-workflow/.github/workflows/workflow.yaml@v1 - needs: test - with: - image: dit-docs/dsm-client - runs-on: "['ubuntu-latest']" - secrets: - username: ${{ secrets.HARBOR_PUBLIC_USER }} - password: ${{ secrets.HARBOR_PUBLIC_TOKEN }} - - deploy: - uses: ./.github/workflows/deploy-base.yaml - needs: build - with: - image: ${{ needs.build.outputs.tag }} - env_url: https://service-manual.docs.dev.krd - env_name: development - - secrets: - KUBECONFIG: ${{ secrets.KUBECONFIG }} diff --git a/.github/workflows/deploy-production.yaml b/.github/workflows/deploy-production.yaml deleted file mode 100644 index 8a6924e..0000000 --- a/.github/workflows/deploy-production.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: Deploy To Production - -on: - push: - branches: - - main - - paths-ignore: - - "README.md" - - ".vscode/**" - - - ".github/**" - - "!.github/workflows/tests-base.yaml" - - "!.github/workflows/deploy-base.yaml" - - "!.github/workflows/deploy-production.yaml" - -concurrency: - group: deploy-production - cancel-in-progress: false - -jobs: - test: - uses: ditkrg/dit-digital-service-manual/.github/workflows/tests-base.yaml@main - - build: - uses: ditkrg/build-image-workflow/.github/workflows/workflow.yaml@v1 - needs: test - with: - image: dit-docs/dsm-client - runs-on: "['ubuntu-latest']" - secrets: - username: ${{ secrets.HARBOR_PUBLIC_USER }} - password: ${{ secrets.HARBOR_PUBLIC_TOKEN }} - - deploy: - uses: ./.github/workflows/deploy-base.yaml - needs: build - with: - image: ${{ needs.build.outputs.tag }} - env_url: https://docs.digital.gov.krd - env_name: production - - secrets: - KUBECONFIG: ${{ secrets.KUBECONFIG }} diff --git a/kubernetes/fleet.yaml b/kubernetes/fleet.yaml new file mode 100644 index 0000000..4036ab7 --- /dev/null +++ b/kubernetes/fleet.yaml @@ -0,0 +1,9 @@ +namespace: dit-docs + +targetCustomizations: + - name: development + clusterSelector: + matchLabels: + env: dev + kustomize: + dir: development