Skip to content

Commit 44c92a0

Browse files
add deploy
1 parent 4e15cac commit 44c92a0

1 file changed

Lines changed: 30 additions & 30 deletions

File tree

deploy.sh

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,33 @@ echo "[--Build: Complete--]"
2121
echo "Executing the deployment upload script"
2222
echo "[--Deployment: Started--]"
2323

24-
# # Check if GITHUB_RUNTIME_PERMANENT_NAME is empty.
25-
# # This will be set when you run with the `copilot_workbench_kv_aca` flag.
26-
# if [ -z "$GITHUB_RUNTIME_PERMANENT_NAME" ]; then
27-
# echo "GITHUB_RUNTIME_PERMANENT_NAME is empty. Falling back to CODESPACE_NAME."
28-
29-
# GITHUB_RUNTIME_PERMANENT_NAME=${CODESPACE_NAME}
30-
# size=${#GITHUB_RUNTIME_PERMANENT_NAME}
31-
# # if size is > 20, then truncate the name.
32-
# # this is a limitation that's also enforced by the dotcom API
33-
# # but I'd rather ensure that the command succeeds.
34-
# if [ $size -gt 20 ]; then
35-
# GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME:0:20}
36-
# fi
37-
# fi
38-
39-
# echo "Deploying as ${GITHUB_USER} to ${GITHUB_RUNTIME_PERMANENT_NAME}"
40-
41-
# gh runtime create \
42-
# --app ${GITHUB_RUNTIME_PERMANENT_NAME} \
43-
# --env "GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME}" \
44-
# --secret "GITHUB_TOKEN=${GITHUB_TOKEN}" \
45-
46-
# gh runtime deploy \
47-
# --app ${GITHUB_RUNTIME_PERMANENT_NAME} \
48-
# --dir dist
49-
50-
# DEPLOYED_URL="$(gh runtime get --app ${GITHUB_RUNTIME_PERMANENT_NAME})"
51-
52-
# echo "[--URL-App=[https://${DEPLOYED_URL}]--]"
53-
# echo "[--Deployment: Complete--]"
24+
# Check if GITHUB_RUNTIME_PERMANENT_NAME is empty.
25+
# This will be set when you run with the `copilot_workbench_kv_aca` flag.
26+
if [ -z "$GITHUB_RUNTIME_PERMANENT_NAME" ]; then
27+
echo "GITHUB_RUNTIME_PERMANENT_NAME is empty. Falling back to CODESPACE_NAME."
28+
29+
GITHUB_RUNTIME_PERMANENT_NAME=${CODESPACE_NAME}
30+
size=${#GITHUB_RUNTIME_PERMANENT_NAME}
31+
# if size is > 20, then truncate the name.
32+
# this is a limitation that's also enforced by the dotcom API
33+
# but I'd rather ensure that the command succeeds.
34+
if [ $size -gt 20 ]; then
35+
GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME:0:20}
36+
fi
37+
fi
38+
39+
echo "Deploying as ${GITHUB_USER} to ${GITHUB_RUNTIME_PERMANENT_NAME}"
40+
41+
gh runtime create \
42+
--app ${GITHUB_RUNTIME_PERMANENT_NAME} \
43+
--env "GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME}" \
44+
--secret "GITHUB_TOKEN=${GITHUB_TOKEN}" \
45+
46+
gh runtime deploy \
47+
--app ${GITHUB_RUNTIME_PERMANENT_NAME} \
48+
--dir dist
49+
50+
DEPLOYED_URL="$(gh runtime get --app ${GITHUB_RUNTIME_PERMANENT_NAME})"
51+
52+
echo "[--URL-App=[https://${DEPLOYED_URL}]--]"
53+
echo "[--Deployment: Complete--]"

0 commit comments

Comments
 (0)