Files
timelapse-calc/.gitea/workflows/deploy.yml
Tien Ngo 932931977e
All checks were successful
Deploy to Private Server / deploy (push) Successful in 12s
update notify step deploy
2025-12-30 11:34:50 +07:00

47 lines
1.3 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 }} - ${{ github.event.head_commit.message }}"
message: |
Branch: ${{ github.ref_name }}
Commit: ${{ github.sha }}
Message: ${{ github.event.head_commit.message }}
Status: ${{ job.status }}
Actor: ${{ github.event.head_commit.author.name }}