awesome/.gitea/workflows/deploy.yml
cheney 381e6a780d
Some checks failed
Build and Deploy / build (push) Successful in 10s
Build and Deploy / deploy (push) Failing after 45s
feat: 版本时间+8区、首页随机卡片点击进详情;chore: 优雅关闭DuckDB、start.sh改用docker stop
2026-09-01 11:40:21 +08:00

48 lines
1.1 KiB
YAML

name: Build and Deploy
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker image
run: |
docker build \
--build-arg GIT_BRANCH="${GITHUB_REF_NAME:-unknown}" \
--build-arg BUILD_TIME="$(TZ=Asia/Shanghai date +%Y%m%d%H%M%S)" \
-t awesome-index:latest .
deploy:
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Copy scripts to server
uses: appleboy/scp-action@master
with:
host: 114.134.187.170
username: root
password: ${{ secrets.SERVER_PASSWORD }}
source: "start.sh,.env.example"
target: "/app/awesome/"
- name: Restart container
uses: appleboy/ssh-action@master
with:
host: 114.134.187.170
username: root
password: ${{ secrets.SERVER_PASSWORD }}
script: |
cd /app/awesome
chmod +x start.sh
bash start.sh