56 Commits

Author SHA1 Message Date
vbevdev ee413eda26 .env.example
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 19:10:25 +03:00
vbevdev 1aa8bae409 ideas moved to repo wiki 2026-07-04 19:10:12 +03:00
vbevdev 158277f0ff deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 18:26:24 +03:00
vbevdev 730077376a deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:52:50 +03:00
vbevdev da67941519 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:51:09 +03:00
vbevdev 264225bb8b deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s
2026-07-04 17:37:03 +03:00
vbevdev cebc67e9a4 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 17:36:00 +03:00
vbevdev 6bb16b3b1f deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:29:48 +03:00
vbevdev 327f4368c6 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:28:51 +03:00
vbevdev b5ebd32a0d deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 5s
2026-07-04 17:25:02 +03:00
vbevdev b840b6bbbc deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:21:07 +03:00
vbevdev 9c0cff6a1b deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:20:07 +03:00
vbevdev 7088ab43ad deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:18:58 +03:00
vbevdev c8fc8776fd deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 17:14:40 +03:00
vbevdev feaf427969 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 17:08:41 +03:00
vbevdev 8700d316fa deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 03:14:25 +03:00
vbevdev fdcd3eac2e deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 03:12:01 +03:00
vbevdev df4d6e064e deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 03:10:41 +03:00
vbevdev 557194a01f deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 03:06:17 +03:00
vbevdev 8b7568c61b deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 03:04:48 +03:00
vbevdev 18687a2f01 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 02:59:01 +03:00
vbevdev 7115cd5d36 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 02:46:21 +03:00
vbevdev 52cd7840ef deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 02:43:27 +03:00
vbevdev 6db07787fa deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 02:39:03 +03:00
vbevdev 23846918e6 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 02:16:55 +03:00
vbevdev af20fc9662 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 02:13:34 +03:00
vbevdev 8f48806208 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 02:08:19 +03:00
vbevdev 15cafea367 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 01:56:26 +03:00
vbevdev 0dd86c53dd deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 01:44:33 +03:00
vbevdev 457bf8e586 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 01:41:14 +03:00
vbevdev 890136634a deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
2026-07-04 01:31:31 +03:00
vbevdev c159c0177f deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 01:27:59 +03:00
vbevdev d0a4990780 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 01:22:01 +03:00
vbevdev 98efc877af deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 01:20:06 +03:00
vbevdev 95ac23906d deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-07-04 01:07:01 +03:00
vbevdev 29d66974cb deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-07-04 01:01:53 +03:00
vbevdev 10d7773a13 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 28s
2026-07-04 00:13:40 +03:00
vbevdev 3f9db6cdc1 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-06-25 02:06:14 +03:00
vbevdev ca2df02029 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-25 02:00:08 +03:00
vbevdev 6d859cf79e deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-25 01:08:53 +03:00
vbevdev fbae09ebe1 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-06-25 00:47:15 +03:00
vbevdev f331f754e1 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
2026-06-25 00:23:14 +03:00
vbevdev b9a1d5bf7d deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-06-23 01:01:19 +03:00
vbevdev 03e987e73f deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-23 01:00:27 +03:00
vbevdev 2a47f28465 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-06-23 00:57:28 +03:00
vbevdev 6f55ebb99c deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-23 00:54:51 +03:00
vbevdev 2bdfa27624 deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-06-23 00:49:27 +03:00
vbevdev ccdac3847f deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
2026-06-23 00:47:49 +03:00
vbevdev 0b1260614e deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-23 00:30:32 +03:00
vbevdev 40b621448c deploy-workflow: create docker compose file
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-23 00:27:05 +03:00
vbevdev 9572e20a2c deploy workflow: create secrets
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 8s
2026-06-23 00:14:19 +03:00
vbevdev 74b8769195 fix deploy workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 6s
2026-06-16 05:48:14 +03:00
vbevdev 807f08734a fix deploy workflow
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-16 05:44:36 +03:00
vbevdev 79d6e9e1b3 deploy workflow draft
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7s
2026-06-16 05:38:24 +03:00
vbevdev 1463b4b78f up runner after git healthy 2026-06-16 05:37:54 +03:00
Бевзенко Владимир Андреевич 85bd65ab59 runner
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 12s
2026-06-16 03:31:47 +03:00
7 changed files with 290 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
BESZEL_HUB_URL=http://mon.localhost
NEXTCLOUD_DOMAIN=cld.localhost
GITEA_URL=http://git:3000
@@ -0,0 +1,16 @@
name: '⚙️ Configure SSH Client'
description: 'Installs sshpass and configures known_hosts'
inputs:
ssh_host:
description: 'Remote server IP'
required: true
runs:
using: 'composite'
steps:
- shell: bash
run: |
sudo apt-get update && sudo apt-get install -y sshpass
mkdir -p ~/.ssh
ssh-keyscan -p 22 "${{ inputs.ssh_host }}" >> ~/.ssh/known_hosts
@@ -0,0 +1,29 @@
name: '🧼 Telegram message escape'
description: 'Automatically escapes dots, dashes, and exclamation marks for Telegram MarkdownV2'
inputs:
message:
description: 'The raw text string to escape'
required: true
outputs:
escaped_message:
description: 'The safely escaped string ready for Telegram'
value: ${{ steps.escape.outputs.result }}
runs:
using: 'composite'
steps:
- id: escape
shell: bash
env:
RAW_MESSAGE: ${{ inputs.message }}
run: |
MSG="$RAW_MESSAGE"
MSG="${MSG//-/\\-}"
MSG="${MSG//./\\.}"
MSG="${MSG//!/\\!}"
echo "result<<EOF" >> $GITHUB_OUTPUT
echo "$MSG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
+19
View File
@@ -0,0 +1,19 @@
name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
+161
View File
@@ -0,0 +1,161 @@
name: 🚀 Deploy
run-name: '🚀 Deploy: ${{ gitea.ref_name }} by @${{ gitea.actor }}'
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout repository
uses: actions/checkout@v4
- name: 🧼 Clean ref name
run: |
ORIGINAL_REF_NAME="${{ gitea.ref_name }}"
CLEAN_REF_NAME=${ORIGINAL_REF_NAME//\//-}
echo "Clean ref name: $CLEAN_REF_NAME"
echo "CLEAN_REF_NAME=$CLEAN_REF_NAME" >> $GITEA_ENV
- name: ⚙️ Configure ssh client
uses: ./.gitea/actions/configure-ssh-client
with:
ssh_host: ${{ secrets.SSH_HOST }}
- name: 📦 Create backup of data/ folder
env:
SSHPASS: ${{ secrets.SSH_PASSWORD }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
DEPLOY_DIRECTORY: ${{ secrets.DEPLOY_DIRECTORY }}
REF_NAME: ${{ env.CLEAN_REF_NAME }}
run: |
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" bash -s << EOT
set -e
cd "$DEPLOY_DIRECTORY"
mkdir -p backups
BACKUP_DATE=\$(date +%Y-%m-%d_%H-%M-%S)
BACKUP_FILE="backups/backup-${REF_NAME}-\${BACKUP_DATE}.tar.gz"
echo "Creating backup of data/ into \${BACKUP_FILE}..."
if [ -d "data" ]; then
tar -czf "\${BACKUP_FILE}" data
echo "✅ Backup created successfully!"
else
echo "⚡️ No data/ folder, backup creation skipped."
fi
find backups/ -type f -name "backup-*.tar.gz" -mtime +7 -delete
EOT
- name: 🏗️ Create docker-compose file
env:
SSHPASS: ${{ secrets.SSH_PASSWORD }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
DEPLOY_DIRECTORY: ${{ secrets.DEPLOY_DIRECTORY }}
REF_NAME: ${{ env.CLEAN_REF_NAME }}
run: |
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" \
"mkdir -p \"$DEPLOY_DIRECTORY\" && \
cd \"$DEPLOY_DIRECTORY\" && \
rm -f docker-compose-*.yml && \
cat > \"docker-compose-$REF_NAME.yml\"" \
< docker-compose.yml
- name: 🔐 Create secrets and envs
env:
SSHPASS: ${{ secrets.SSH_PASSWORD }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
DEPLOY_DIRECTORY: ${{ secrets.DEPLOY_DIRECTORY }}
BESZEL_AGENT_KEY: ${{ secrets.BESZEL_AGENT_KEY }}
BESZEL_AGENT_TOKEN: ${{ secrets.BESZEL_AGENT_TOKEN }}
BESZEL_HUB_URL: ${{ vars.BESZEL_HUB_URL }}
GITEA_RUNNER_REGISTRATION_TOKEN: ${{ secrets.RUNNER_REGISTRATION_TOKEN }}
GITEA_URL: ${{ vars.GIT_URL }}
VAULTWARDEN_ADMIN_TOKEN: ${{ secrets.VAULTWARDEN_ADMIN_TOKEN }}
NEXTCLOUD_DOMAIN: ${{ vars.NEXTCLOUD_DOMAIN }}
run: |
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" bash -s << EOT
set -e
cd "$DEPLOY_DIRECTORY"
cat << 'EOF_ENV' > .env
BESZEL_HUB_URL=$BESZEL_HUB_URL
NEXTCLOUD_DOMAIN=$NEXTCLOUD_DOMAIN
GITEA_URL=$GITEA_URL
EOF_ENV
mkdir -p secrets
cat << 'EOF_SECRET' > secrets/beszel_agent_key.txt
$BESZEL_AGENT_KEY
EOF_SECRET
cat << 'EOF_SECRET' > secrets/beszel_agent_token.txt
$BESZEL_AGENT_TOKEN
EOF_SECRET
cat << 'EOF_SECRET' > secrets/gitea_runner_registration_token.txt
$GITEA_RUNNER_REGISTRATION_TOKEN
EOF_SECRET
cat << 'EOF_SECRET' > secrets/vaultwarden_admin_token.txt
$VAULTWARDEN_ADMIN_TOKEN
EOF_SECRET
chmod 700 secrets
chmod 600 secrets/*.txt
EOT
- name: 🚀 Run new containers
env:
SSHPASS: ${{ secrets.SSH_PASSWORD }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
DEPLOY_DIRECTORY: ${{ secrets.DEPLOY_DIRECTORY }}
REF_NAME: ${{ env.CLEAN_REF_NAME }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_DEPLOY_BOT_TOKEN }}
TELEGRAM_CHAT: ${{ secrets.TELEGRAM_DEPLOY_CHAT_ID }}
PROXY_URL: ${{ secrets.PROXY_URL }}
SUCCESS_MESSAGE: |-
✅ <b>Успешный деплой!</b>
Релиз: <code>${{ gitea.ref_name }}</code>
FAILURE_MESSAGE: |-
❌ <b>Ошибка деплоя!</b>
Релиз: <code>${{ gitea.ref_name }}</code>
DEPLOY_LOG_FILE: /tmp/deploy-${{ env.CLEAN_REF_NAME }}.log
run: |
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" bash -s << EOT
set -e
cd "$DEPLOY_DIRECTORY"
nohup bash -c '
sleep 5
if docker compose --dry-run -f "docker-compose-${REF_NAME}.yml" up -d --remove-orphans > ${DEPLOY_LOG_FILE} 2>&1; then
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
--proxy "${PROXY_URL}" \
-d "chat_id=${TELEGRAM_CHAT}" \
-d "parse_mode=HTML" \
--data-urlencode "text=${SUCCESS_MESSAGE}" > /dev/null
else
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
--proxy "${PROXY_URL}" \
-d "chat_id=${TELEGRAM_CHAT}" \
-d "parse_mode=HTML" \
--data-urlencode "text=${FAILURE_MESSAGE}" > /dev/null
fi
curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendDocument" \
--proxy "${PROXY_URL}" \
-F "chat_id=${TELEGRAM_CHAT}" \
-F "document=@${DEPLOY_LOG_FILE}" > /dev/null && rm -f ${DEPLOY_LOG_FILE}
' > /dev/null 2>&1 &
EOT
echo "New containers will be started after 5 seconds"
@@ -0,0 +1,36 @@
name: 🤖 Test telegram deploy bot
run-name: '🤖 Test telegram deploy bot: ${{ gitea.ref_name }} by @${{ gitea.actor }}'
on:
workflow_dispatch:
jobs:
send_test_message:
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout repository
uses: actions/checkout@v4
- name: ⚙️ Configure ssh client
uses: ./.gitea/actions/configure-ssh-client
with:
ssh_host: ${{ secrets.SSH_HOST }}
- name: 💬 Send message
env:
SSHPASS: ${{ secrets.SSH_PASSWORD }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
SSH_HOST: ${{ secrets.SSH_HOST }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_DEPLOY_BOT_TOKEN }}
TELEGRAM_CHAT: ${{ secrets.TELEGRAM_DEPLOY_CHAT_ID }}
PROXY_URL: ${{ secrets.PROXY_URL }}
MESSAGE: ${{ steps.prepare_message.outputs.escaped_message }}
run: |
sshpass -e ssh -p 22 "$SSH_USERNAME@$SSH_HOST" bash -s << EOT
set -e
curl -s --connect-timeout 10 -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
--proxy "${PROXY_URL}" \
-d "chat_id=${TELEGRAM_CHAT}" \
-d "parse_mode=HTML" \
--data-urlencode "text=💬 Test message"
EOT
+25 -1
View File
@@ -73,11 +73,32 @@ services:
image: 'docker.gitea.com/gitea:1.26.2' image: 'docker.gitea.com/gitea:1.26.2'
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ./data/gitea:/data - ./data/gitea/gitea:/data
environment: environment:
GITEA__service__DISABLE_REGISTRATION: true GITEA__service__DISABLE_REGISTRATION: true
GITEA__other__SHOW_FOOTER_VERSION: false GITEA__other__SHOW_FOOTER_VERSION: false
GITEA__other__SHOW_FOOTER_POWERED_BY: false GITEA__other__SHOW_FOOTER_POWERED_BY: false
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
interval: 10s
timeout: 5s
retries: 3
git-runner:
image: 'gitea/act_runner:latest'
depends_on:
git:
condition: service_healthy
environment:
CONFIG_FILE: /config.yaml
GITEA_INSTANCE_URL: "${GITEA_URL}"
GITEA_RUNNER_REGISTRATION_TOKEN_FILE: /run/secrets/gitea_runner_registration_token
volumes:
- ./data/gitea/runner/config.yaml:/config.yaml
- ./data/gitea/runner/data:/data
- /var/run/docker.sock:/var/run/docker.sock
secrets:
- gitea_runner_registration_token
networks: networks:
default: default:
@@ -90,3 +111,6 @@ secrets:
file: secrets/beszel_agent_key.txt file: secrets/beszel_agent_key.txt
beszel_agent_token: beszel_agent_token:
file: secrets/beszel_agent_token.txt file: secrets/beszel_agent_token.txt
gitea_runner_registration_token:
file: secrets/gitea_runner_registration_token.txt