fix(actions): rework validate workflow file to skip installation steps solved by the custom container image
All checks were successful
/ validate (push) Successful in 5m21s
All checks were successful
/ validate (push) Successful in 5m21s
This commit is contained in:
parent
274bd9c3d2
commit
25e490b9e0
1 changed files with 16 additions and 22 deletions
|
|
@ -2,7 +2,6 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate:
|
validate:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
|
@ -12,16 +11,9 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DOCKER_HOST: tcp://172.17.0.1:2375
|
DOCKER_HOST: tcp://172.17.0.1:2375
|
||||||
steps:
|
steps:
|
||||||
- name: Setup
|
|
||||||
run: apk add bash curl
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install kubeconform
|
|
||||||
run: |
|
|
||||||
wget -O- https://github.com/yannh/kubeconform/releases/latest/download/kubeconform-linux-amd64.tar.gz | tar xz
|
|
||||||
mv kubeconform /usr/local/bin
|
|
||||||
|
|
||||||
- name: Validate manifests
|
- name: Validate manifests
|
||||||
run: |
|
run: |
|
||||||
kubeconform \
|
kubeconform \
|
||||||
|
|
@ -31,29 +23,22 @@ jobs:
|
||||||
-schema-location default \
|
-schema-location default \
|
||||||
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
|
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json' \
|
||||||
./manifests/
|
./manifests/
|
||||||
- name: Install k3d
|
|
||||||
run: |
|
|
||||||
curl -fsSL -o /tmp/k3d https://github.com/k3d-io/k3d/releases/download/v5.7.4/k3d-linux-amd64
|
|
||||||
chmod +x /tmp/k3d
|
|
||||||
mv /tmp/k3d /usr/local/bin
|
|
||||||
- name: Install kubectl
|
|
||||||
run: |
|
|
||||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
|
||||||
chmod +x kubectl
|
|
||||||
mv kubectl /usr/local/bin
|
|
||||||
- name: Create test cluster
|
- name: Create test cluster
|
||||||
run: |
|
run: |
|
||||||
k3d cluster create test --wait
|
k3d cluster create test --wait
|
||||||
kubectl cluster-info
|
|
||||||
- name: Install ArgoCD
|
- name: Install ArgoCD
|
||||||
run: |
|
run: |
|
||||||
kubectl create namespace argocd
|
kubectl create namespace argocd
|
||||||
kubectl apply -n argocd --server-side -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
kubectl apply -n argocd --server-side -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
|
||||||
kubectl wait --for=condition=available --timeout=180s deployment/argocd-server -n argocd
|
kubectl wait --for=condition=available --timeout=180s deployment/argocd-server -n argocd
|
||||||
|
|
||||||
- name: Install SealedSecrets
|
- name: Install SealedSecrets
|
||||||
run: |
|
run: |
|
||||||
kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.27.0/controller.yaml
|
kubectl apply -f https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.27.0/controller.yaml
|
||||||
kubectl wait --for=condition=available --timeout=60s deployment/sealed-secrets-controller -n kube-system
|
kubectl wait --for=condition=available --timeout=60s deployment/sealed-secrets-controller -n kube-system
|
||||||
|
|
||||||
- name: Import SealedSecrets key
|
- name: Import SealedSecrets key
|
||||||
env:
|
env:
|
||||||
SEALED_SECRETS_KEY: ${{ secrets.SEALED_SECRETS_KEY }}
|
SEALED_SECRETS_KEY: ${{ secrets.SEALED_SECRETS_KEY }}
|
||||||
|
|
@ -61,14 +46,23 @@ jobs:
|
||||||
echo "$SEALED_SECRETS_KEY" | kubectl apply -f -
|
echo "$SEALED_SECRETS_KEY" | kubectl apply -f -
|
||||||
kubectl rollout restart deployment/sealed-secrets-controller -n kube-system
|
kubectl rollout restart deployment/sealed-secrets-controller -n kube-system
|
||||||
kubectl rollout status deployment/sealed-secrets-controller -n kube-system --timeout=60s
|
kubectl rollout status deployment/sealed-secrets-controller -n kube-system --timeout=60s
|
||||||
|
|
||||||
- name: Apply ArgoCD apps
|
- name: Apply ArgoCD apps
|
||||||
run: |
|
run: |
|
||||||
kubectl apply -f apps/
|
kubectl apply -f apps/
|
||||||
|
|
||||||
- name: Wait for everything
|
- name: Wait for ArgoCD sync
|
||||||
run: |
|
run: |
|
||||||
sleep 30
|
kubectl wait --for=condition=available --timeout=300s deployment --all -n argocd
|
||||||
kubectl wait --for=condition=available --timeout=120s deployment --all --all-namespaces
|
until kubectl get applications -n argocd -o jsonpath='{.items[*].status.sync.status}' | grep -v OutOfSync; do
|
||||||
|
echo "Waiting for ArgoCD to sync..."
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Wait for all deployments
|
||||||
|
run: |
|
||||||
|
kubectl wait --for=condition=available --timeout=300s deployment --all --all-namespaces
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue