Skip to content

Commit

Permalink
up v1
Browse files Browse the repository at this point in the history
  • Loading branch information
lyj0309 authored Dec 31, 2024
1 parent b2ed97d commit b7e9caa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,22 @@ jobs:
- uses: superfly/flyctl-actions/setup-flyctl@master

- run: |
n=`date -d "2 day ago" "+%Y-%m-%d"`
l=$(wget -qO- -t1 -T2 "https://api.github.com/repos/naiba/nezha/releases/latest" | jq -r ".published_at")
if [[ $l =~ $n ]]
then
echo "new_release=yes" >> $GITHUB_ENV
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "new_release=yes" >> $GITHUB_ENV
else
echo "new_release=no" >> $GITHUB_ENV
n=`date -d "2 day ago" "+%Y-%m-%d"`
l=$(wget -qO- -t1 -T2 "https://api.github.com/repos/nezhahq/nezha/releases/latest" | jq -r ".published_at")
if [[ $l =~ $n ]]; then
echo "new_release=yes" >> $GITHUB_ENV
else
echo "new_release=no" >> $GITHUB_ENV
fi
fi
- name: deploy
if: ${{ env.new_release == 'yes' }}
run: |
echo '${{ secrets.CONFIG }}' > ./config.yaml && ls
# echo '${{ secrets.CONFIG }}' > ./config.yaml && ls
flyctl deploy --remote-only
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ghcr.io/naiba/nezha-dashboard:latest
FROM ghcr.io/nezhahq/nezha
# RUN apk --no-cache --no-progress add openssh-client

# ADD https://github.com/benbjohnson/litestream/releases/download/v0.3.8/litestream-v0.3.8-linux-amd64-static.tar.gz /tmp/litestream.tar.gz
# RUN tar -C /usr/local/bin -xzf /tmp/litestream.tar.gz && rm /tmp/litestream.tar.g
# COPY etc/litestream.yml /etc/litestream.yml

COPY config.yaml .
COPY run.sh .
RUN chmod 777 *
ENTRYPOINT ["./run.sh"]
# COPY config.yaml .
# COPY run.sh .
# RUN chmod 777 *
# ENTRYPOINT ["./run.sh"]
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@
## 部署哪吒面板到fly.io

## 原理
通过基于原哪吒面板的docker镜像,在此基础上自动添加config文件,其中config文件在github secrets中
通过基于原哪吒面板的docker镜像,在fly.io中mount做持久化储存

两个secrets
`CONFIG`: 哪吒面板配置文件
https://fly.io/docs/volumes/overview/

action secrets
`FLY_API_TOKEN`: fly的api token

## 第一次部署
1. 需要把`action`中的`if: ${{ env.new_release == 'yes' }}`注释掉,部署成功之后再注回来
```yml
- name: deploy
if: ${{ env.new_release == 'yes' }}
run: |
echo '${{ secrets.CONFIG }}' > ./config.yaml && ls
flyctl deploy --remote-only
```
2. 需要先运行`fly launch`创建一个app,名字填`fly.toml`里面的, 我的是`fakev-status`可以改,但需要保持一样
## 首次部署

1. 先运行`fly launch`创建一个app,名字填`fly.toml`里面的, 我的是`fakev-status`可以改,但需要保持一样
2. 要手动触发action
3. 打开网站修改设置,比如站点名称,url
## 展示网址 (<https://status.fakev.cn>

0 comments on commit b7e9caa

Please sign in to comment.