Gitea läuft seit 2026-11-11 auf hivegrid-control (git.hg-int.dev); git.tool-ctrl.de wird abgeschaltet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
63 lines
2.3 KiB
YAML
63 lines
2.3 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: toolctrl-ci
|
|
steps:
|
|
- name: Setup hosts override and Docker CLI
|
|
run: |
|
|
echo "195.201.133.26 git.hg-int.dev" >> /etc/hosts
|
|
apt-get update -qq
|
|
apt-get install -qq -y --no-install-recommends ca-certificates curl git
|
|
install -m 0755 -d /etc/apt/keyrings
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | tee /etc/apt/keyrings/docker.asc >/dev/null
|
|
chmod a+r /etc/apt/keyrings/docker.asc
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list >/dev/null
|
|
apt-get update -qq
|
|
apt-get install -qq -y --no-install-recommends docker-ce-cli docker-buildx-plugin
|
|
docker --version
|
|
docker buildx version
|
|
|
|
- name: Checkout
|
|
run: |
|
|
mkdir -p /workspace/repo
|
|
cd /workspace/repo
|
|
git clone "https://${{ secrets.REGISTRY_USER }}:${{ secrets.REGISTRY_PAT }}@git.hg-int.dev/${{ github.repository }}.git" .
|
|
git checkout "${{ github.sha }}"
|
|
|
|
- name: Static checks
|
|
run: |
|
|
cd /workspace/repo
|
|
node --check server.js
|
|
git diff --check
|
|
|
|
- name: Login to Gitea Registry
|
|
run: echo "${{ secrets.REGISTRY_PAT }}" | docker login git.hg-int.dev --username "${{ secrets.REGISTRY_USER }}" --password-stdin
|
|
|
|
- name: Build and push image
|
|
env:
|
|
IMAGE: git.hg-int.dev/${{ github.repository }}
|
|
SHA: ${{ github.sha }}
|
|
run: |
|
|
cd /workspace/repo
|
|
SHORT_SHA=${SHA:0:7}
|
|
IMAGE_LC=$(echo "$IMAGE" | tr '[:upper:]' '[:lower:]')
|
|
docker build \
|
|
--build-arg APP_REVISION="$SHA" \
|
|
-t "$IMAGE_LC:$SHORT_SHA" \
|
|
-t "$IMAGE_LC:main" \
|
|
.
|
|
docker push "$IMAGE_LC:$SHORT_SHA"
|
|
docker push "$IMAGE_LC:main"
|
|
|
|
- name: Trigger Coolify deploy
|
|
run: |
|
|
curl -fsS -X POST \
|
|
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
|
|
"https://saas-ctrl.com/api/v1/applications/ocwtt7rd2zijtlszgua005k9/start"
|