35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
name: MT5 Stack Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
container: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
|
|
# HINWEIS: Terraform-Binary kommt wie bei boday_tf über das globale Runner-Volume (:ro)
|
|
|
|
# Nur versionierte Dateien deployen (kein .git, keine Secrets, keine Laufzeitdaten)
|
|
- name: Build deploy bundle
|
|
run: |
|
|
rm -rf .deploy-bundle && mkdir .deploy-bundle
|
|
git archive HEAD | tar -x -C .deploy-bundle
|
|
if find .deploy-bundle -name bots.env -o -name .env -o -name '*.session' | grep -q .; then
|
|
echo "ABBRUCH: bots.env / .env / *.session ist im Repo versioniert"; exit 1
|
|
fi
|
|
du -sh .deploy-bundle
|
|
|
|
- name: Terraform Deploy
|
|
env:
|
|
TF_VAR_ssh_private_key: ${{ secrets.DEPLOY_SSH_KEY }}
|
|
TF_VAR_ssh_host: ${{ vars.DEPLOY_HOST || 'BITMT503' }}
|
|
run: |
|
|
terraform --version
|
|
for i in 1 2 3; do terraform init && break; echo "init fehlgeschlagen, Versuch $i"; sleep 10; done
|
|
terraform apply -auto-approve
|