forked from AnimMouse/setup-cloudflared
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
94 lines (85 loc) · 3.41 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Setup cloudflared
description: Setup/Install Cloudflare Tunnel client for GitHub Actions
branding:
icon: cloud
color: orange
inputs:
cloudflare_tunnel_credential:
description: Cloudflare Tunnel Credential encoded in Base64 (deadbeef-1234-4321-abcd-123456789abc.json)
required: true
cloudflare_tunnel_configuration:
description: Cloudflare Tunnel Configuration encoded in Base64 (config.yaml)
required: true
cloudflare_tunnel_id:
description: Cloudflare Tunnel ID (deadbeef-1234-4321-abcd-123456789abc)
required: true
autostart:
description: Autostart cloudflared in the background
default: true
version:
description: cloudflared version
default: latest
token:
description: GitHub token to avoid API rate limiting
default: ${{ github.token }}
runs:
using: composite
steps:
- name: Get cloudflared version for Unix-like
id: version-unix-like
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: $GITHUB_ACTION_PATH/scripts/version/Unix-like.sh
env:
version: ${{ inputs.version }}
GITHUB_TOKEN: ${{ inputs.token }}
- name: Get cloudflared version for Windows
id: version-windows
if: runner.os == 'Windows'
shell: pwsh
run: '& $env:GITHUB_ACTION_PATH\scripts\version\Windows.ps1'
env:
version: ${{ inputs.version }}
GITHUB_TOKEN: ${{ inputs.token }}
- name: Download cloudflared for Unix-like
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
working-directory: ${{ runner.temp }}
run: $GITHUB_ACTION_PATH/scripts/download/Unix-like.sh
env:
version: ${{ steps.version-unix-like.outputs.version }}
- name: Download cloudflared for Windows
if: runner.os == 'Windows'
shell: pwsh
working-directory: ${{ runner.temp }}
run: '& $env:GITHUB_ACTION_PATH\scripts\download\Windows.ps1'
env:
version: ${{ steps.version-windows.outputs.version }}
- name: Install cloudflared on tool cache
uses: AnimMouse/tool-cache@v1
with:
folder_name: cloudflared
- name: Sign in to cloudflared on Unix-like
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: $GITHUB_ACTION_PATH/scripts/sign-in/Unix-like.sh
env:
cloudflare_tunnel_credential: ${{ inputs.cloudflare_tunnel_credential }}
cloudflare_tunnel_configuration: ${{ inputs.cloudflare_tunnel_configuration }}
cloudflare_tunnel_id: ${{ inputs.cloudflare_tunnel_id }}
- name: Sign in to cloudflared on Windows
if: runner.os == 'Windows'
shell: pwsh
run: '& $env:GITHUB_ACTION_PATH\scripts\sign-in\Windows.ps1'
env:
cloudflare_tunnel_credential: ${{ inputs.cloudflare_tunnel_credential }}
cloudflare_tunnel_configuration: ${{ inputs.cloudflare_tunnel_configuration }}
cloudflare_tunnel_id: ${{ inputs.cloudflare_tunnel_id }}
- name: Start cloudflared in the background on Unix-like
if: (runner.os == 'Linux' || runner.os == 'macOS') && inputs.autostart != 'false'
shell: bash
run: $GITHUB_ACTION_PATH/scripts/autostart/Unix-like.sh
- name: Start cloudflared in the background on Windows
if: runner.os == 'Windows' && inputs.autostart != 'false'
shell: pwsh
run: '& $env:GITHUB_ACTION_PATH\scripts\autostart\Windows.ps1'