awesome/.gitea/workflows/deploy.yml
cheney a5c5d24083
All checks were successful
Build and Deploy / build (push) Successful in 12s
Build and Deploy / deploy (push) Successful in 26s
refactor: 彻底移除 docker compose,改用纯 docker 构建+重启部署
2026-09-01 10:27:11 +08:00

45 lines
1006 B
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 -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