Files
tsrun/.gitea/workflows/deploy.yml
T
dmgnr f609231ede
Deploy tsrun / deploy (push) Has been cancelled
Update .gitea/workflows/deploy.yml
2026-09-01 07:38:04 +00:00

47 lines
1.7 KiB
YAML

name: Deploy tsrun
#a
on:
push:
branches: [main]
jobs:
deploy:
steps:
- uses: actions/checkout@v4
- name: Write embedded manifest
run: |
mkdir -p secrets
printf '%s' '${{ secrets.TSRUN_MANIFEST_JSON }}' > secrets/tsrun.manifest.json
- name: Build and push
run: |
TAG=${{ gitea.sha }}
IMAGE=registry.neko-piranha.ts.net/astral/tsrun
docker buildx create --use --name tsrun-bootstrap-builder || docker buildx use tsrun-bootstrap-builder
docker buildx build --platform linux/arm64 -t $IMAGE:$TAG -t $IMAGE:latest --push .
- name: Install kubectl
run: |
ARCH=$(uname -m)
case "$ARCH" in
x86_64) KARCH=amd64 ;;
aarch64|arm64) KARCH=arm64 ;;
*) echo "unsupported kubectl arch: $ARCH" >&2; exit 1 ;;
esac
curl -fsSL "https://dl.k8s.io/release/$(curl -fsSL https://dl.k8s.io/release/stable.txt)/bin/linux/${KARCH}/kubectl" -o /usr/local/bin/kubectl
chmod +x /usr/local/bin/kubectl
- name: Configure kubectl
run: |
kubectl config set-cluster astral --server=https://100.75.220.33:6443 --insecure-skip-tls-verify=true
kubectl config set-credentials ci-deployer --token=${{ secrets.KUBE_TOKEN }}
kubectl config set-context astral --cluster=astral --user=ci-deployer --namespace=default
kubectl config use-context astral
- name: Rollout
run: |
kubectl set image deployment/tsrun tsrun=registry.neko-piranha.ts.net/astral/tsrun:${{ gitea.sha }} -n default
kubectl rollout status deployment/tsrun -n default --timeout=180s