Compare commits

..

No commits in common. "84ec9cf196e6b3b0686d0a4f506d9bcfe9bdc5e1" and "ea50afcd5cc355fdcc8b979e40c9c13c70f3663e" have entirely different histories.

3 changed files with 16 additions and 16 deletions

View File

@ -1 +1 @@
# k8sdeploy@v1
# checkout@v1

View File

@ -13,3 +13,8 @@ runs:
steps:
- name: k8sdeploy
run: ${{ gitea.action_path }}/k8sdeploy.sh
env:
ACTION_REPO: ${{ gitea.repository }}
ACTION_KUBECONFIG: ${{ inputs.kubeconfig }}
ACTION_REGISTRY_USERNAME: ${{ inputs.registry_username }}
ACTION_REGISTRY_PASSWORD: ${{ inputs.registry_password }}

View File

@ -6,23 +6,18 @@ set -a
set +a
REGISTRY="${IMAGEAPP%%/*}"
export K8S_NS="${GITHUB_REPOSITORY#*/}-${GITHUB_REF_NAME}"
NS="${ACTION_REPO#*/}"
mkdir -p "$HOME/.kube/"
echo "$INPUT_KUBECONFIG" > "$HOME/.kube/config"
kubectl get namespace "$K8S_NS" || kubectl create namespace "$K8S_NS"
kubectl config set-context --current --namespace="$K8S_NS"
echo "$ACTION_KUBECONFIG" > "$HOME/.kube/config"
kubectl get namespace "$NS" || kubectl create namespace "$NS"
kubectl config set-context --current --namespace="$NS"
if [ -n "$INPUT_REGISTRY_PASSWORD" ]; then
kubectl get secret regcred \
|| kubectl create secret docker-registry regcred \
--docker-server="$REGISTRY" \
--docker-username="$INPUT_REGISTRY_USERNAME" \
--docker-password="$INPUT_REGISTRY_PASSWORD"
if [ -n "$ACTION_REGISTRY_PASSWD" ]; then
kubectl create secret docker-registry regcred \
--docker-server="$REGISTRY" \
--docker-username="$ACTION_REGISTRY_USER" \
--docker-password="$ACTION_REGISTRY_PASSWD"
fi
if [ "$GITHUB_REF_NAME" = prod ] || [ "$GITHUB_REF_NAME" = staging ]; then
./manifests/bin/prod.sh
else
./manifests/bin/devel.sh
fi
./manifests/bin/devel.sh