├── .github └── workflows │ └── auto-deploy.yml ├── Dockerfile ├── README.md ├── entrypoint.sh └── files.tar.gz /.github/workflows/auto-deploy.yml: -------------------------------------------------------------------------------- 1 | name: Redeploy Choreo 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 */3 * * *' 7 | 8 | jobs: 9 | Redeploy: 10 | name: Redeploy Choreo 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v4.0.0 16 | with: 17 | fetch-depth: 1 18 | 19 | - name: Renew README.md 20 | run: | 21 | DATE=$(date "+%Y/%m/%d %H:%M:%S") 22 | echo "${DATE}" > README.md 23 | git checkout --orphan tmp_work 24 | git branch -d main 25 | echo "DATE=${DATE}" >> $GITHUB_ENV 26 | 27 | - name: Upload to repository 28 | uses: stefanzweifel/git-auto-commit-action@v4.16.0 29 | with: 30 | commit_message: Auto deploy by Github Actions, ${{ env.DATE }} 31 | create_branch: true 32 | branch: main 33 | push_options: --force 34 | 35 | - name: Delete old workflow runs 36 | uses: MajorScruffy/delete-old-workflow-runs@v0.3.0 37 | env: 38 | GITHUB_TOKEN: ${{ github.token }} 39 | with: 40 | repository: ${{ github.repository }} 41 | older-than-seconds: 3600 42 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | 3 | WORKDIR /home/choreouser 4 | 5 | ADD files.tar.gz entrypoint.sh ./ 6 | 7 | RUN apk add --no-cache iproute2 vim netcat-openbsd &&\ 8 | APP=$(tr -dc 'A-Za-z0-9' /tmp/config.base64 222 | 223 | # 如果有设置哪吒探针三个变量,会安装。如果不填或者不全,则不会安装 224 | if [ -n "${NEZHA_SERVER}" ] && [ -n "${NEZHA_PORT}" ] && [ -n "${NEZHA_KEY}" ]; then 225 | TLS=${NEZHA_TLS:+'--tls'} 226 | wget -O /tmp/nezha-agent.zip https://github.com/nezhahq/agent/releases/latest/download/nezha-agent_linux_$(uname -m | sed "s#x86_64#amd64#; s#aarch64#arm64#").zip 227 | unzip /tmp/nezha-agent.zip -d /tmp 228 | chmod +x /tmp/nezha-agent 229 | rm -f /tmp/nezha-agent.zip 230 | nohup /tmp/nezha-agent -s ${NEZHA_SERVER}:${NEZHA_PORT} -p ${NEZHA_KEY} ${TLS} 2>&1 & 231 | fi 232 | 233 | # 不输出日志运行 APP 234 | APP=$(ls [A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]) 235 | base64 -d /tmp/config.base64 | nohup ./${APP} run >/dev/null 2>&1 & 236 | 237 | # 保持脚本不结束 238 | tail -f /dev/null 239 | -------------------------------------------------------------------------------- /files.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fscarmen2/Choreo2/673befc24958572278cea9c3942c11ddc1c551ff/files.tar.gz --------------------------------------------------------------------------------