2
0

run.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Renew Certificate
  2. on:
  3. # push:
  4. # branches: [ master ]
  5. # pull_request:
  6. # branches: [ master ]
  7. workflow_dispatch:
  8. schedule:
  9. - cron: "0 23 */1 */1 *" # every day 23:00
  10. # - cron: "0 23 20 */2 *" # every 2 months 20 23:00
  11. jobs:
  12. run-script:
  13. runs-on: ubuntu-latest
  14. steps:
  15. # - name: Set Variables
  16. # run: |
  17. # echo "DNSCRYPT_PROXY_VERSION=$(curl -fsSL https://api.github.com/repos/dnscrypt/dnscrypt-proxy/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')" >> $GITHUB_ENV
  18. # echo "CADDY_VERSION=$(curl -fsSL https://api.github.com/repos/caddyserver/caddy/releases/latest | grep '"tag_name":' | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/v//g;s/,//g;s/ //g')" >> $GITHUB_ENV
  19. # echo "V2RAY_VERSION=$(curl -fsSL https://api.github.com/repos/v2fly/v2ray-core/releases/latest | grep '"tag_name":' | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/v//g;s/,//g;s/ //g')" >> $GITHUB_ENV
  20. # echo "XRAY_VERSION=$(curl -fsSL https://api.github.com/repos/xtls/xray-core/releases/latest | grep '"tag_name":' | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/v//g;s/,//g;s/ //g')" >> $GITHUB_ENV
  21. # echo "NAIVE_VERSION=$(curl -fsSL https://api.github.com/repos/klzgrad/naiveproxy/releases/latest | grep '"tag_name":' | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/v//g;s/,//g;s/ //g')" >> $GITHUB_ENV
  22. # echo "FRP_VERSION=$(curl -fsSL https://api.github.com/repos/fatedier/frp/releases/latest | grep '"tag_name":' | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/v//g;s/,//g;s/ //g')" >> $GITHUB_ENV
  23. # echo "SYNCTHING_VERSION=$(curl -fsSL https://api.github.com/repos/syncthing/syncthing/releases/latest | grep '"tag_name":' | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/v//g;s/,//g;s/ //g')" >> $GITHUB_ENV
  24. # echo "KCPTUN_VERSION=$(curl -fsSL https://api.github.com/repos/xtaci/kcptun/releases/latest | grep '"tag_name":' | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/v//g;s/,//g;s/ //g')" >> $GITHUB_ENV
  25. # echo "UDP2RAW_VERSION=$(curl -fsSL https://api.github.com/repos/wangyu-/udp2raw-tunnel/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')" >> $GITHUB_ENV
  26. # echo "TINYVPN_VERSION=$(curl -fsSL https://api.github.com/repos/wangyu-/tinyfecvpn/releases/latest | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')" >> $GITHUB_ENV
  27. # cat $GITHUB_ENV
  28. # shell: bash
  29. # - name: Set timezone
  30. # uses: szenius/[email protected]
  31. # with:
  32. # timezoneLinux: "Asia/Shanghai"
  33. - name: Renew Certificate
  34. uses: appleboy/ssh-action@master
  35. with:
  36. host: ${{ secrets.VPS_HKG_HOSTNAME }}
  37. username: ${{ secrets.VPS_USERNAME }}
  38. key: ${{ secrets.VPS_KEY }}
  39. port: ${{ secrets.VPS_PORT }}
  40. # fingerprint: ${{ secrets.VPS_FINGERPRINT }}
  41. script_stop: true
  42. # TEST
  43. # script: |
  44. # whoami
  45. # ls -al
  46. script: |
  47. cd /root/devops/docker/common/lego
  48. bash docker_run.sh