Add Gitea Actions workflow for auto-deploy
Some checks failed
deploy-tunnel / deploy (push) Failing after 2s
Some checks failed
deploy-tunnel / deploy (push) Failing after 2s
This commit is contained in:
43
.gitea/workflows/deploy.yml
Normal file
43
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: deploy-tunnel
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
#───────────────── deploy ─────────────────
|
||||
deploy:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Verify credentials.json exists
|
||||
run: |
|
||||
if [ ! -f credentials.json ]; then
|
||||
echo "⚠️ credentials.json not found!"
|
||||
echo " Make sure to copy it to the repo root before deploying"
|
||||
echo " cp ~/.cloudflared/<TUNNEL_ID>.json ./credentials.json"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ credentials.json found"
|
||||
|
||||
- name: Verify .env exists
|
||||
run: |
|
||||
if [ ! -f .env ]; then
|
||||
echo "⚠️ .env file not found!"
|
||||
echo " Copy .env.example to .env and configure TUNNEL_ID"
|
||||
exit 1
|
||||
fi
|
||||
echo "✓ .env file found"
|
||||
|
||||
- name: Pull fresh cloudflared image
|
||||
run: docker compose pull
|
||||
|
||||
- name: Clean up stack
|
||||
run: docker compose --project-name cloudflared-tunnel down
|
||||
|
||||
- name: Update stack
|
||||
run: docker compose --project-name cloudflared-tunnel up -d --remove-orphans --wait
|
||||
|
||||
- name: Show tunnel status
|
||||
run: docker compose --project-name cloudflared-tunnel logs --tail=50
|
||||
Reference in New Issue
Block a user