-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathaction.yml
More file actions
69 lines (62 loc) · 2.49 KB
/
action.yml
File metadata and controls
69 lines (62 loc) · 2.49 KB
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
name: Setup cloudflared
description: Setup/Install Cloudflare Tunnel client for GitHub Actions
branding:
icon: cloud
color: orange
inputs:
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: Restore cloudflared cache
id: cache
uses: actions/cache/restore@v4
with:
path: ${{ runner.tool_cache }}/cloudflared
key: cloudflared-${{ steps.version-unix-like.outputs.version || steps.version-windows.outputs.version }}-${{ runner.os }}
- name: Download cloudflared for Unix-like
if: (runner.os == 'Linux' || runner.os == 'macOS') && (! steps.cache.outputs.cache-hit || steps.cache.outputs.cache-hit == 'false')
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' && (! steps.cache.outputs.cache-hit || steps.cache.outputs.cache-hit == 'false')
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
cache_hit: ${{ steps.cache.outputs.cache-hit }}
- name: Save cloudflared cache
if: "! steps.cache.outputs.cache-hit || steps.cache.outputs.cache-hit == 'false'"
uses: actions/cache/save@v4
with:
path: ${{ runner.tool_cache }}/cloudflared
key: cloudflared-${{ steps.version-unix-like.outputs.version || steps.version-windows.outputs.version }}-${{ runner.os }}