Files
quay-kubernetes/.gitea/workflows/deploy.yml
T
feedc0de ff96903291
Validate and deploy Quay / Validate manifest (push) Successful in 23s
Validate and deploy Quay / Downtime deployment (push) Has been cancelled
Initial commit with existing kubernetes config and CI
2026-08-08 23:57:48 +02:00

86 lines
2.7 KiB
YAML

name: Validate and deploy Quay
on:
push:
paths:
- quay.yaml
- .gitea/workflows/deploy.yml
pull_request:
paths:
- quay.yaml
- .gitea/workflows/deploy.yml
env:
KUBECTL_VERSION: v1.36.3
KUBERNETES_API: https://host.containers.internal:6443
KUBERNETES_TLS_SERVER_NAME: 192.168.0.2
NAMESPACE: default
jobs:
validate:
name: Validate manifest
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Validate scripts and Kubernetes resources
run: bash test.sh
deploy:
name: Downtime deployment
if: gitea.ref == 'refs/heads/main'
needs: validate
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Install kubectl
run: |
curl --fail --silent --show-error --location \
--output "${RUNNER_TEMP}/kubectl" \
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
curl --fail --silent --show-error --location \
--output "${RUNNER_TEMP}/kubectl.sha256" \
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256"
printf '%s %s\n' "$(cat "${RUNNER_TEMP}/kubectl.sha256")" "${RUNNER_TEMP}/kubectl" | sha256sum --check
chmod 0700 "${RUNNER_TEMP}/kubectl"
- name: Configure Kubernetes access
env:
KUBE_CONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64 }}
run: |
test -n "${KUBE_CONFIG_BASE64}"
printf '%s' "${KUBE_CONFIG_BASE64}" | base64 --decode > "${RUNNER_TEMP}/kubeconfig"
chmod 0600 "${RUNNER_TEMP}/kubeconfig"
export KUBECONFIG="${RUNNER_TEMP}/kubeconfig"
"${RUNNER_TEMP}/kubectl" config set-cluster cluster \
--server="${KUBERNETES_API}" \
--tls-server-name="${KUBERNETES_TLS_SERVER_NAME}"
- name: Validate desired state on the server
run: |
export KUBECONFIG="${RUNNER_TEMP}/kubeconfig"
"${RUNNER_TEMP}/kubectl" apply \
--dry-run=server \
--validate=false \
--filename quay.yaml
- name: Apply and verify
run: |
export KUBECONFIG="${RUNNER_TEMP}/kubeconfig"
"${RUNNER_TEMP}/kubectl" apply \
--validate=false \
--filename quay.yaml
for deployment in quay quay-repomirror; do
"${RUNNER_TEMP}/kubectl" --namespace "${NAMESPACE}" rollout status \
"deployment/${deployment}" \
--timeout=15m
done
curl --fail --silent --show-error \
--max-time 15 \
https://registry.brunner.ninja/health/endtoend >/dev/null