Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
|
74cc9d7436 | |
|
a160159f1f | |
|
31fc538f0f | |
|
6b9d9e604e | |
|
4d94b3cbdb | |
|
2355a1a4dd |
|
@ -1,7 +1,7 @@
|
|||
name: Deploy to Test
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
branches: [dev]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
@ -10,22 +10,17 @@ jobs:
|
|||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: https://gitea.com/actions/checkout@v4
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
# 指定分支、标签或提交哈希
|
||||
ref: main
|
||||
ref: dev
|
||||
# 拉取深度(节省时间与带宽)
|
||||
fetch-depth: 0 # 0 表示拉取完整的历史
|
||||
|
||||
- name: Replace Debian APT sources
|
||||
run: |
|
||||
tee /etc/apt/sources.list <<EOF
|
||||
# 清华大学 Debian 11 Bullseye 镜像
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
|
||||
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
|
||||
EOF
|
||||
sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
|
||||
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
|
||||
|
||||
- name: Install SSH tools
|
||||
run: |
|
||||
|
|
|
@ -1,11 +1,7 @@
|
|||
version: '3.8'
|
||||
version: '3.8'
|
||||
services:
|
||||
php:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
USER_ID: "1001"
|
||||
GROUP_ID: "1001"
|
||||
build: . # 指向 Dockerfile 目录
|
||||
volumes:
|
||||
- /data/laravel_test:/var/www/html
|
||||
working_dir: /var/www/html
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
FROM php:7.3-fpm
|
||||
ARG USER_ID
|
||||
ARG GROUP_ID
|
||||
|
||||
RUN echo "USER_ID: ${USER_ID}"
|
||||
FROM php:7.3-fpm
|
||||
|
||||
# 替换为清华大学镜像源(Debian 10 Buster)
|
||||
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
|
||||
|
@ -20,6 +16,8 @@ RUN curl -sS https://getcomposer.org/installer | php -- \
|
|||
--filename=composer
|
||||
|
||||
# 创建非 root 用户(推荐与宿主机用户 UID/GID 一致)
|
||||
ARG USER_ID=1001 # 宿主机 deploy-user 的 UID
|
||||
ARG GROUP_ID=1001 # 宿主机 deploy-user 的 GID
|
||||
RUN groupadd -g ${GROUP_ID} appuser \
|
||||
&& useradd -u ${USER_ID} -g appuser -m -d /home/appuser -s /bin/bash appuser
|
||||
|
||||
|
|
|
@ -18,5 +18,5 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
|
|||
});
|
||||
|
||||
Route::get('/test', function () {
|
||||
return ["msg" => "success", "data" => [], "status" => 0];
|
||||
return ["msg" => "success", "data" => [], "status" => 200];
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue