feat: 添加 Gitea Actions 自动部署流水线
Deploy Examination / deploy (push) Successful in 24s

- nginx:alpine 托管静态站点
- push 到 main 自动构建并部署到 30000 端口
This commit is contained in:
2026-09-02 19:40:42 +08:00
parent b567cca425
commit 71ceeaf704
2 changed files with 44 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
name: Deploy Examination
on:
push:
branches:
- main
jobs:
deploy:
runs-on: aliyun
steps:
- name: Setup Environment
run: |
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
apk add --no-cache docker-cli
- name: Checkout
run: |
rm -rf /tmp/examination
git clone --depth 1 -b main \
http://47.121.181.112:3000/wonder/examination.git \
/tmp/examination
- name: Build Docker Image
run: |
docker build \
-t examination-site:latest \
/tmp/examination
- name: Deploy Container
run: |
docker stop examination-site 2>/dev/null || true
docker rm examination-site 2>/dev/null || true
docker run -d \
--name examination-site \
--restart unless-stopped \
-p 30000:80 \
examination-site:latest
- name: Cleanup Dangling Images
run: docker image prune -f
+3
View File
@@ -0,0 +1,3 @@
FROM nginx:alpine
COPY . /usr/share/nginx/html
EXPOSE 80