Files
timelapse-calc/.gitea/workflows/deploy.yml
Tien Ngo 4feec19d2c
All checks were successful
Deploy to Private Server / deploy (push) Successful in 13s
ci: add Gitea Actions workflow for Docker-based deployment to private server.
2025-12-29 16:48:37 +07:00

50 lines
1.4 KiB
YAML

name: Deploy to Private Server
on:
push:
branches: ["main"]
jobs:
deploy:
runs-on: homesrv
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build -t timelapse-calc:latest \
-f Dockerfile .
- name: Stop old container if exists
run: |
if docker ps -a --format '{{.Names}}' | grep -q '^timelapse-calc$'; then
docker stop timelapse-calc
docker rm timelapse-calc
fi
- name: Run new container
run: |
docker run -d \
--restart always \
--name timelapse-calc \
-p 3005:80 \
timelapse-calc:latest
docker ps --format "{{.Names}} {{.Image}} {{.Status}}"
- name: Send Deployment Notification
uses: https://git.hcmc.online/actions/deploy-notify@main
if: always()
with:
status: ${{ job.status }}
title: "Deploy: ${{ github.repository }}"
message: |
Ref: ${{ github.ref_name }}
Commit: ${{ github.sha }}
Status: ${{ job.status }}
Actor: ${{ github.actor }}
gmail_password: ${{ secrets.GMAIL_PASSWORD }}
ntfy_password: ${{ secrets.NTFY_PASSWORD }}
telegram_bot_token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
telegram_chat_id: ${{ secrets.TELEGRAM_CHAT_ID }}