Files
Tien Ngo ddcdca156c
All checks were successful
Deploy to Private Server / deploy (push) Successful in 13s
fix ntfy
2025-12-30 14:58:31 +07:00

45 lines
1.2 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
- 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 }}
Message: ${{ github.event.head_commit.message }}
Status: ${{ job.status }}
Actor: ${{ github.event.head_commit.author.name }}