-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
157 lines (153 loc) · 7.59 KB
/
Copy pathaction.yml
File metadata and controls
157 lines (153 loc) · 7.59 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: "CyberDrain Azure SWA Deploy"
description: "Drop-in replacement for Azure/static-web-apps-deploy focused on performance"
branding:
icon: "upload-cloud"
color: "green"
inputs:
# ---- Azure/static-web-apps-deploy compatible inputs ----
azure_static_web_apps_api_token:
description: "Deployment token for the Static Web App. Registered with ::add-mask:: so it cannot appear in logs."
required: true
action:
description: "Action to perform. Only 'upload' is supported."
required: false
default: "upload"
app_location:
description: "Directory location of the application source code, relative to the repository root. Must stay inside the workspace. Ignored when zip_url is set."
required: false
default: "/"
output_location:
description: "Directory location of the compiled application code, relative to app_location. Omit to deploy app_location itself."
required: false
app_artifact_location:
description: "Identical in use to output_location. Only consulted when output_location is empty."
required: false
config_file_location:
description: "Directory containing staticwebapp.config.json, or the path to the file itself. Added at the payload root; a config already at the root wins."
required: false
deployment_environment:
description: "Name of the Azure Static Web Apps environment to deploy to. Azure only accepts letters and digits. Empty deploys to production."
required: false
production_branch:
description: "When specified, deployments from other branches go to a preview environment named after the branch, with non-alphanumeric characters removed."
required: false
app_build_command:
description: "Custom build command, run in the platform shell. Overrides package-manager detection. Cannot be combined with zip_url."
required: false
skip_app_build:
description: "Skips the build step and deploys the content as-is"
required: false
skip_api_build:
description: "Accepted for compatibility. No API build is ever run."
required: false
is_static_export:
description: "Accepted for compatibility. Oryx-only hint, no effect here."
required: false
repo_token:
description: "Accepted for compatibility. Unused - this action does not comment on pull requests."
required: false
github_id_token:
description: "Accepted for compatibility. Unused."
required: false
api_build_command:
description: "Not supported - managed Azure Functions need the official action. Fails if set."
required: false
api_location:
description: "Not supported - managed Azure Functions need the official action. Fails if set."
required: false
data_api_location:
description: "Not supported - Data API needs the official action. Fails if set."
required: false
routes_location:
description: "Not supported - routes.json is deprecated. Fails if set."
required: false
# ---- additions ----
require_config_file:
description: "How to handle a payload with no staticwebapp.config.json at its root, or one that will not parse. 'warn' annotates the run, 'error' refuses to deploy before anything is uploaded, 'off' says nothing. Without the config Azure applies platform defaults, so routes and allowedRoles are not enforced and every path is served anonymously."
required: false
default: "warn"
install_node:
description: "When the runner's Node does not satisfy engines.node, resolve the range against nodejs.org and install a matching release. Set false to warn instead."
required: false
default: "true"
zip_url:
description: "http(s) URL of a zip to download and deploy instead of app_location. Skips checkout and build entirely."
required: false
zip_subdirectory:
description: "When deploying from a .zip, the subdirectory inside it to deploy (e.g. 'out'). May not contain '..'."
required: false
max_download_mb:
description: "Largest zip_url download to accept, in MB. Enforced while streaming, not from Content-Length."
required: false
default: "1024"
verbose:
description: "Log every API request. Request paths only - never the token or query strings."
required: false
default: "false"
# Written on the failure paths as well as on success, so a follow-up step can report on a
# broken deployment. That step needs if: always() to run at all.
outputs:
static_web_app_url:
description: "Url of the deployed application. Set only on a successful deployment."
value: ${{ steps.deploy.outputs.static_web_app_url }}
deployment_status:
description: "Succeeded, Failed, Canceled, TimedOut, Unknown (lost contact while Azure was still distributing), or Error (failed before deploying)."
value: ${{ steps.deploy.outputs.deployment_status }}
deployment_environment:
description: "Environment that was deployed to. Empty means production."
value: ${{ steps.deploy.outputs.deployment_environment }}
file_count:
description: "Number of files in the deployed payload."
value: ${{ steps.deploy.outputs.file_count }}
app_size_bytes:
description: "Uncompressed size of the deployed payload, in bytes."
value: ${{ steps.deploy.outputs.app_size_bytes }}
compressed_size_bytes:
description: "Size of the uploaded zip, in bytes."
value: ${{ steps.deploy.outputs.compressed_size_bytes }}
has_config_file:
description: "'true' when staticwebapp.config.json was at the payload root."
value: ${{ steps.deploy.outputs.has_config_file }}
build_duration_seconds:
description: "Seconds spent building. 0 when the build was skipped."
value: ${{ steps.deploy.outputs.build_duration_seconds }}
deploy_duration_seconds:
description: "Seconds spent packaging, uploading and distributing."
value: ${{ steps.deploy.outputs.deploy_duration_seconds }}
total_duration_seconds:
description: "Seconds the action took end to end."
value: ${{ steps.deploy.outputs.total_duration_seconds }}
correlation_id:
description: "Deployment correlation ID. The first thing Azure support asks for."
value: ${{ steps.deploy.outputs.correlation_id }}
runs:
using: composite
steps:
- id: deploy
shell: pwsh
env:
INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ inputs.azure_static_web_apps_api_token }}
INPUT_ACTION: ${{ inputs.action }}
INPUT_APP_LOCATION: ${{ inputs.app_location }}
INPUT_OUTPUT_LOCATION: ${{ inputs.output_location }}
INPUT_APP_ARTIFACT_LOCATION: ${{ inputs.app_artifact_location }}
INPUT_CONFIG_FILE_LOCATION: ${{ inputs.config_file_location }}
INPUT_DEPLOYMENT_ENVIRONMENT: ${{ inputs.deployment_environment }}
INPUT_PRODUCTION_BRANCH: ${{ inputs.production_branch }}
INPUT_SKIP_APP_BUILD: ${{ inputs.skip_app_build }}
INPUT_SKIP_API_BUILD: ${{ inputs.skip_api_build }}
INPUT_IS_STATIC_EXPORT: ${{ inputs.is_static_export }}
INPUT_REPO_TOKEN: ${{ inputs.repo_token }}
INPUT_GITHUB_ID_TOKEN: ${{ inputs.github_id_token }}
INPUT_APP_BUILD_COMMAND: ${{ inputs.app_build_command }}
INPUT_API_BUILD_COMMAND: ${{ inputs.api_build_command }}
INPUT_API_LOCATION: ${{ inputs.api_location }}
INPUT_DATA_API_LOCATION: ${{ inputs.data_api_location }}
INPUT_ROUTES_LOCATION: ${{ inputs.routes_location }}
INPUT_REQUIRE_CONFIG_FILE: ${{ inputs.require_config_file }}
INPUT_INSTALL_NODE: ${{ inputs.install_node }}
INPUT_ZIP_URL: ${{ inputs.zip_url }}
INPUT_ZIP_SUBDIRECTORY: ${{ inputs.zip_subdirectory }}
INPUT_MAX_DOWNLOAD_MB: ${{ inputs.max_download_mb }}
INPUT_VERBOSE: ${{ inputs.verbose }}
run: ${{ github.action_path }}/src/Invoke-Action.ps1