-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9b61500
Showing
5 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Fly Deploy | ||
on: | ||
push: | ||
schedule: | ||
- cron: '30 20 * * *' | ||
|
||
|
||
env: | ||
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
jobs: | ||
deploy: | ||
name: Deploy app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: echo '${{ secrets.CONFIG }}' > ./config.yaml | ||
|
||
- uses: superfly/flyctl-actions/setup-flyctl@master | ||
- run: flyctl deploy --remote-only | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/litestream.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM ghcr.io/naiba/nezha-dashboard:latest | ||
# 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 . | ||
ENTRYPOINT ["./run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# fly.toml file generated for testnz on 2022-05-22T20:58:35+08:00 | ||
|
||
app = "testnz" | ||
|
||
kill_signal = "SIGINT" | ||
kill_timeout = 5 | ||
processes = [] | ||
|
||
[env] | ||
[mounts] | ||
source="nztest_data" | ||
destination="/dashboard/data" | ||
|
||
[experimental] | ||
allowed_public_ports = [] | ||
auto_rollback = true | ||
|
||
|
||
[[services]] | ||
http_checks = [] | ||
internal_port = 80 | ||
processes = ["app"] | ||
protocol = "tcp" | ||
script_checks = [] | ||
|
||
[services.concurrency] | ||
hard_limit = 25 | ||
soft_limit = 20 | ||
type = "connections" | ||
|
||
[[services.ports]] | ||
handlers = ["http"] | ||
port = 80 | ||
|
||
[[services.ports]] | ||
handlers = ["tls", "http"] | ||
port = 443 | ||
|
||
[[services.tcp_checks]] | ||
grace_period = "1s" | ||
interval = "15s" | ||
restart_limit = 0 | ||
timeout = "2s" | ||
|
||
[[services]] | ||
http_checks = [] | ||
internal_port = 5555 | ||
processes = ["app"] | ||
protocol = "tcp" | ||
script_checks = [] | ||
|
||
[services.concurrency] | ||
hard_limit = 25 | ||
soft_limit = 20 | ||
type = "connections" | ||
|
||
[[services.ports]] | ||
port = 5555 | ||
|
||
[[services.tcp_checks]] | ||
grace_period = "1s" | ||
interval = "15s" | ||
restart_limit = 0 | ||
timeout = "2s" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
echo -e "nameserver 127.0.0.11\nnameserver 8.8.8.8\nnameserver 223.5.5.5\n" > /etc/resolv.conf | ||
|
||
if [ -f /dashboard/data/config.yaml ]; then | ||
echo "配置文件存在,跳过配置" | ||
else | ||
echo "配置文件不存在,初始化默认配置" | ||
cp /dashboard/config.yaml /dashboard/data/config.yaml | ||
fi | ||
|
||
# Restore the database if it does not already exist. | ||
# if [ -f /data/db ]; then | ||
# echo "Database already exists, skipping restore" | ||
# else | ||
# echo "No database found, restoring from replica if exists" | ||
# litestream restore -v -if-replica-exists -o /data/db "${REPLICA_URL}" | ||
# fi | ||
|
||
# # Run litestream with your app as the subprocess. | ||
# exec litestream replicate -exec "/usr/local/bin/myapp -dsn /data/db" | ||
|
||
/dashboard/app |