-
Notifications
You must be signed in to change notification settings - Fork 2
/
action.yml
92 lines (89 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
name: 'OSS Deployment Action'
author: 'Yang Hanlin'
description: 'GitHub Action to deploy static files to Aliyun (Alibaba Cloud) OSS'
inputs:
oss-endpoint:
description: 'OSS endpoint (required if ossutil is not pre-configured)'
required: false
default: ''
oss-accesskey-id:
description: 'AccessKey ID of user with write access to OSS (required if ossutil is not pre-configured)'
required: false
default: ''
oss-accesskey-secret:
description: 'AccessKey secret of the user identified by the previous AccessKey ID (required if ossutil is not pre-configured)'
required: false
default: ''
oss-sts-token:
description: 'STS token (required only if using STS and ossutil is not pre-configured)'
required: false
default: ''
oss-path:
description: 'Path to the location you''d like to deploy files to, i.e. oss://<BUCKET NAME>/<PATH>'
required: true
local-path:
description: 'Path to the location you''d like to deploy files from'
required: false
default: '.'
ignored-patterns:
description: 'Blob patterns of files (separated by spaces) to ignore in deployment'
required: false
default: '.git'
delete-first:
description: 'Whether to delete files under `oss-path` before deployment'
required: false
default: 'false'
force-setup-ossutil:
description: 'Whether to force download and configure even if ossutil is pre-configured'
required: false
default: 'false'
cache-ossutil:
description: 'Whether to cache downloaded ossutil'
required: false
default: 'false'
debug:
description: 'Whether to enable debug logging'
required: false
default: 'false'
ossutil-version-:
description: 'Version of ossutil to download if none is found in PATH; this input parameter is undocumented and NOT guaranteed to be stable'
required: false
default: '1.7.15'
runs:
using: 'composite'
steps:
- name: Run script to prepare variables
run: "'${{ github.action_path }}/bin/prepare-variables.sh'"
shell: bash
id: prepare-variables
env:
OSSUTIL_VERSION: ${{ inputs.ossutil-version- }}
DEBUG: ${{ inputs.debug }}
- name: Set up cache
uses: actions/cache@v3
if: inputs.cache-ossutil == 'true'
with:
path: ${{ steps.prepare-variables.outputs.workspace }}
key: ${{ steps.prepare-variables.outputs.cache-key }}
- name: Run script to deploy
run: "'${{ github.action_path }}/bin/deploy.sh'"
shell: bash
env:
OSS_ENDPOINT: ${{ inputs.oss-endpoint }}
OSS_ACCESSKEY_ID: ${{ inputs.oss-accesskey-id }}
OSS_ACCESSKEY_SECRET: ${{ inputs.oss-accesskey-secret }}
OSS_STS_TOKEN: ${{ inputs.oss-sts-token }}
OSS_PATH: ${{ inputs.oss-path }}
LOCAL_PATH: ${{ inputs.local-path }}
IGNORED_PATTERNS: ${{ inputs.ignored-patterns }}
DELETE_FIRST: ${{ inputs.delete-first }}
FORCE_SETUP_OSSUTIL: ${{ inputs.force-setup-ossutil }}
DEBUG: ${{ inputs.DEBUG }}
WORKSPACE: ${{ steps.prepare-variables.outputs.workspace }}
OS_TYPE: ${{ steps.prepare-variables.outputs.os-type }}
OSSUTIL_EXECUTABLE_NAME: ${{ steps.prepare-variables.outputs.ossutil-executable-name }}
OSSUTIL_SPEC: ${{ steps.prepare-variables.outputs.ossutil-spec }}
OSSUTIL_DOWNLOAD_URL: ${{ steps.prepare-variables.outputs.ossutil-download-url }}
branding:
color: orange
icon: upload-cloud