]> git.proxmox.com Git - mirror_acme.sh.git/blob - .github/workflows/LetsEncrypt.yml
check token before run
[mirror_acme.sh.git] / .github / workflows / LetsEncrypt.yml
1 name: LetsEncrypt
2 on:
3 push:
4 branches:
5 - '*'
6 paths:
7 - '**.sh'
8 pull_request:
9 branches:
10 - dev
11 paths:
12 - '**.sh'
13
14
15 jobs:
16 CheckToken:
17 runs-on: ubuntu-latest
18 outputs:
19 hasToken: ${{ steps.step_one.outputs.hasToken }}
20 env:
21 NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
22 steps:
23 - name: Set the value
24 id: step_one
25 run: [ "$NGROK_TOKEN" ] && echo "::set-output name=hasToken::true" || echo "::set-output name=hasToken::false"
26 - name: Check the value
27 run: echo ${{ steps.step_one.outputs.hasToken }}
28
29 Ubuntu:
30 runs-on: ubuntu-latest
31 needs: CheckToken
32 if: "contains(needs.CheckToken.outputs.hasToken, 'true')"
33 env:
34 NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
35 TEST_LOCAL: 1
36 steps:
37 - uses: actions/checkout@v2
38 - name: Install tools
39 run: sudo apt-get install -y socat
40 - name: Clone acmetest
41 run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
42 - name: Run acmetest
43 run: cd ../acmetest && sudo TEST_LOCAL="$TEST_LOCAL" NGROK_TOKEN="$NGROK_TOKEN" ./letest.sh
44
45 MacOS:
46 runs-on: macos-latest
47 needs: Ubuntu
48 env:
49 NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
50 TEST_LOCAL: 1
51 steps:
52 - uses: actions/checkout@v2
53 - name: Install tools
54 run: brew update && brew install socat;
55 - name: Clone acmetest
56 run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/
57 - name: Run acmetest
58 run: cd ../acmetest && sudo TEST_LOCAL="$TEST_LOCAL" NGROK_TOKEN="$NGROK_TOKEN" ./letest.sh
59
60 Windows:
61 runs-on: windows-latest
62 needs: MacOS
63 env:
64 NGROK_TOKEN : ${{ secrets.NGROK_TOKEN }}
65 TEST_LOCAL: 1
66 #The 80 port is used by Windows server, we have to use a custom port, ngrok will also use this port.
67 Le_HTTPPort: 8888
68 steps:
69 - uses: actions/checkout@v2
70 - name: Install cygwin base packages with chocolatey
71 run: |
72 choco config get cacheLocation
73 choco install --no-progress cygwin
74 shell: cmd
75 - name: Install cygwin additional packages
76 run: |
77 C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -s http://mirrors.kernel.org/sourceware/cygwin/ -P socat,curl,cron,unzip,git
78 shell: cmd
79 - name: Set ENV
80 run: |
81 echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin'
82 - name: Clone acmetest
83 shell: cmd
84 run: cd .. && git clone https://github.com/acmesh-official/acmetest.git && cp -r acme.sh acmetest/ && sed -i 's/\r//g' acmetest/acme.sh/acme.sh
85 - name: Run acmetest
86 shell: cmd
87 run: cd ../acmetest && bash.exe -c ./letest.sh
88
89