feat(deployment): add GitHub Actions workflow for server deployment

This commit is contained in:
shiyu
2025-05-24 15:14:23 +08:00
parent 12e2023e8c
commit ab5351d250
3 changed files with 49 additions and 35 deletions
+29
View File
@@ -0,0 +1,29 @@
name: Deploy to Server
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v3
- name: 部署到服务器
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
script: |
docker pull ghcr.io/drizzletime/foxel:dev
docker stop foxel-container || true
docker rm foxel-container || true
docker run -d --name foxel-container -p 8848:80 \
-e "DEFAULT_CONNECTION=${{ secrets.DEFAULT_CONNECTION }}" \
--pull always ghcr.io/drizzletime/foxel:dev
+1
View File
@@ -29,6 +29,7 @@
</ItemGroup>
<ItemGroup>
<Content Include=".github\workflows\deployment.yml" />
<Content Include=".github\workflows\docker.yml" />
</ItemGroup>
+3 -19
View File
@@ -15,6 +15,7 @@
> 🖥️ **在线演示:**
> 访问 [https://foxel.cc](https://foxel.cc) 体验 Foxel 部分功能。
> 管理员账号:`demo@foxel.cc` 密码: `foxel_demo`
> ⚠️ **注意:演示环境数据可能不定期清理,请勿存放重要信息。**
---
@@ -41,6 +42,7 @@
### ⚙️ 一键部署
1. **拉取并运行容器**
```bash
docker run -d -p 80:80 --name foxel \
-v /path/to/uploads:/app/Uploads \
@@ -87,7 +89,6 @@ ghcr.io/drizzletime/foxel:dev
CREATE EXTENSION IF NOT EXISTS vector;
```
---
## 📖 适配存储
@@ -118,24 +119,7 @@ Foxel 提供多种存储后端选择,满足不同场景下的部署需求:
---
<picture>
<source
media="(prefers-color-scheme: dark)"
srcset="
https://api.star-history.com/svg?repos=DrizzleTime/Foxel&type=Date&theme=dark
"
/>
<source
media="(prefers-color-scheme: light)"
srcset="
https://api.star-history.com/svg?repos=DrizzleTime/Foxel&type=Date
"
/>
<img
alt="Star History Chart"
src="https://api.star-history.com/svg?repos=DrizzleTime/Foxel&type=Date"
/>
</picture>
![Star History Chart](https://api.star-history.com/svg?repos=DrizzleTime/Foxel&type=Date)
<p align="center">
<img src="https://img.shields.io/badge/License-MIT-blueviolet?style=for-the-badge" alt="MIT License" style="display:inline-block; vertical-align:middle;">