feat: 增加自动部署
All checks were successful
Build and Deploy on Main Merge / deploy (push) Successful in 9s
All checks were successful
Build and Deploy on Main Merge / deploy (push) Successful in 9s
This commit is contained in:
parent
cc66cba656
commit
f35fccc94f
39
.gitea/workflows/deploy.yml
Normal file
39
.gitea/workflows/deploy.yml
Normal 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
11
docker-compose.yml
Normal 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
|
||||
Loading…
x
Reference in New Issue
Block a user