Revert "Deploy using Rancher Fleet"

This reverts commit 77bf4f8da9.

Signed-off-by: Shakar <5h4k4r.b4kr@gmail.com>
This commit is contained in:
Shakar 2023-04-04 17:05:15 +03:00
parent 4e8bdaabde
commit a700e397a8
No known key found for this signature in database
GPG Key ID: DA55A26823AE3C28
4 changed files with 144 additions and 9 deletions

54
.github/workflows/deploy-base.yaml vendored Normal file
View File

@ -0,0 +1,54 @@
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

45
.github/workflows/deploy-dev.yaml vendored Normal file
View File

@ -0,0 +1,45 @@
---
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 }}

View File

@ -0,0 +1,45 @@
---
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 }}

View File

@ -1,9 +0,0 @@
namespace: dit-docs
targetCustomizations:
- name: development
clusterSelector:
matchLabels:
env: dev
kustomize:
dir: development