awesome/.gitea/workflows/deploy.yml
cheney 64f3f6ea58
Some checks failed
Build and Deploy / build (push) Successful in 11s
Build and Deploy / deploy (push) Failing after 49s
feat: 首页版本号、简介布局与反显、密钥眼睛融合、定时拉取开关
2026-09-01 11:15:35 +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="$(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