Skip to content

Commit 9f7f119

Browse files
committed
fix: artifact script
Signed-off-by: Innei <[email protected]>
1 parent 55b994c commit 9f7f119

File tree

3 files changed

+35
-22
lines changed

3 files changed

+35
-22
lines changed

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,28 +72,18 @@
7272

7373
## :whale: Docker 部署
7474

75-
### :books: docker-compose
75+
### :books: 推荐使用 Docker Compose
7676

77-
1. change the args inside `docker-compose.yml`
77+
```sh
78+
mkdir shiro
79+
cd shiro
80+
wget https://raw.githubusercontent.com/Innei/Shiro/main/docker-compose.yml
81+
wget https://raw.githubusercontent.com/Innei/Shiro/main/.env.template .env
7882

79-
2. run command
83+
vim .env # 修改你的 ENV 变量
84+
docker compose up -d
8085

81-
```bash
82-
docker-compose up -d
83-
```
84-
85-
### :package: docker run
86-
87-
```bash
88-
docker build \
89-
--build-arg BASE_URL=REPLACE_WITH_YOUR_BASE_URL \
90-
--build-arg NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=REPLACE_WITH_YOUR_PUBLISHABLE_KEY \
91-
--build-arg CLERK_SECRET_KEY=REPLACE_WITH_YOUR_SECRET_KEY \
92-
-t shiro . --load
93-
```
94-
95-
```bash
96-
docker run --name shiro -d -p 2323:2323 shiro
86+
docker compose pull # 后续更新镜像
9787
```
9888

9989
## Markdown 扩展语法

docker-compose.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ version: '3'
33
services:
44
shiro:
55
container_name: shiro
6-
build:
7-
context: .
6+
image: innei/shiro:latest
87
volumes:
9-
- /app/.env:./.docker-env
8+
- ./.env:/app/.env
109
restart: always
1110
ports:
1211
- 2323:2323
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# 使用环境变量 GH_TOKEN
5+
curl_response=$(curl -L -H "Accept: application/vnd.github+json" \
6+
-H "Authorization: Bearer $GH_TOKEN" \
7+
"https://api.github.com/repos/innei/shiro/actions/artifacts?per_page=5&page=1")
8+
download_url=$(echo $curl_response | jq -r '.artifacts[] | select(.name == "artifact") | .archive_download_url')
9+
10+
if [ -z "$download_url" ] || [ "$download_url" == "null" ]; then
11+
echo "没有找到 URL 或发生了错误。"
12+
exit 1
13+
else
14+
echo "找到的 URL: $download_url"
15+
# 此处可以添加用于下载文件的命令,例如:
16+
# curl -L "$download_url" -o desired_filename.zip
17+
fi
18+
19+
# 使用环境变量 GH_TOKEN
20+
curl -L -H "Authorization: Bearer $GH_TOKEN" "$download_url" -o build.zip
21+
22+
[ ! -d "shiro" ] && mkdir shiro
23+
unzip build.zip
24+
unzip -o release.zip 'standalone/*' -d shiro

0 commit comments

Comments
 (0)