feat: 增加自动部署
All checks were successful
Build and Deploy on Main Merge / deploy (push) Successful in 9s

This commit is contained in:
李岩岩 2026-07-06 09:36:02 +08:00
parent cc66cba656
commit f35fccc94f
2 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,39 @@
name: Build and Deploy on Main Merge
on:
push:
branches:
- main
env:
REGISTRY_HOST: gitea.proxy.liyanyan.work
DOCKER_NAME: iptv-gh-pages
jobs:
deploy:
runs-on: ubuntu-22.04
container:
volumes:
- /vol1/1000/app:/app
steps:
- name: Checkout code
uses: https://gitea.proxy.liyanyan.work/github/checkout@v4
- name: Prepare deploy directory
run: |
mkdir -p /app/${{ gitea.repository }}/site/
cp -f docker-compose.yml /app/${{ gitea.repository }}/
find . -maxdepth 1 ! -name docker-compose.yml ! -name .git ! -name .gitea ! -name . -exec cp -rf {} /app/${{ gitea.repository }}/site/ \;
- name: Run with docker compose
run: |
cd /app/${{ gitea.repository }}
if [ $(docker ps -q -f name=${DOCKER_NAME}) ]; then
echo 服务已启动...
# docker compose down
# docker compose up -d
else
echo 服务启动中...
docker compose up -d
fi

11
docker-compose.yml Normal file
View File

@ -0,0 +1,11 @@
version: "3"
services:
iptv-gh-pages:
image: docker.liyanyan.work/library/nginx:alpine
container_name: iptv-gh-pages
ports:
- "65500:80"
volumes:
- ./site:/usr/share/nginx/html:ro
restart: unless-stopped