├── .env.sample
├── .gitignore
├── Dockerfile
├── LICENSE
├── README.md
├── action.yml
├── entrypoint.sh
└── run.sh
/.env.sample:
--------------------------------------------------------------------------------
1 | GHOST_HOSTED_URL=https://content.yoursite.com/blog
2 | GHOST_STATIC_HOST_URL=https://yoursite.com/blog
3 | S3_BUCKET_NAME=s3-bucket-name
4 | AWS_ACCESS_KEY_ID=access-key-id
5 | AWS_SECRET_ACCESS_KEY=secret-access-key
6 | AWS_DEFAULT_REGION=us-east-1
7 |
8 | AWS_AMPLIFY_APP_ID=amplify-app-id
9 | AWS_AMPLIFY_BRANCH_NAME=amplify-branch-name
10 |
11 | # CUSTOM_REPLACE_KEYS and CUSTOM_REPLACE_VALUES must be comma seperated values and number of elements should be same.
12 | CUSTOM_REPLACE_KEYS="key_1", "key_2"
13 | CUSTOM_REPLACE_VALUES="value_1", "value_2"
14 |
15 | # To replace ld+json data in the root index file use following variable
16 | ROOT_INDEX_JSONLD={"@context":"http://schema.org","@type":"Organization"}
17 | # To add breadcrumb ld+json data in the root index file use following variable
18 | BREADCRUMB_ROOT_INDEX_JSONLD={"@context":"https://schema.org","@type":"BreadcrumbList"}
19 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .env
2 | .DS_Store
3 | # Rubymine IDE files
4 | .idea/*
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM bash:5.1.16-alpine3.15
2 |
3 | RUN apk add --no-cache zip curl jq wget aws-cli
4 |
5 | ENV GHOST_STATIC_CONTENT_DIR=/src/content
6 |
7 | COPY entrypoint.sh /entrypoint.sh
8 | RUN mkdir -p ${GHOST_STATIC_CONTENT_DIR}
9 | COPY run.sh /src/
10 |
11 | ENTRYPOINT ["/entrypoint.sh"]
12 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | Copyright © 2023 True Sparrow
3 |
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Ghost Static Website Generator
2 |
3 | Generate static HTML files for custom ghost hosting and publish them on AWS S3 as static website.
4 | To host the static blog site under a path `/blog` (`https://yourdomain.com/blog`), the ghost needs to be hosted with the same path like `https://content.yourdomain.com/blog`.
5 |
6 | If your blog is hosted under `https://content.yourdomain.com` and you want to host the static website under `https://yourdomain.com/blog`, this is not possible. Same applies for the other way around.
7 |
8 | You can also replace certain text from the generated static files by passing the following arguments `custom_replace_keys` and `custom_replace_values`. For more details, refer Inputs and Example usage section. It doesn't support the multiline replacement as of now.
9 |
10 | Optionally, you can either host the static files on AWS S3 or on AWS Amplify.
11 |
12 | To host Static Blog on AWS S3, provide the following input parameters:
13 |
14 | - `s3_bucket_name` (Make the bucket publicly accessible and enable static web hosting)
15 |
16 | - `aws_access_key_id`
17 |
18 | - `aws_secret_access_key`
19 |
20 | - `aws_region`
21 |
22 | To host Static Blog on already existing AWS Amplify application, provide the following input parameters:
23 |
24 | - `aws_amplify_app_id`
25 |
26 | - `aws_amplify_branch_name`
27 |
28 | - `aws_access_key_id`
29 |
30 | - `aws_secret_access_key`
31 |
32 | - `aws_region`
33 |
34 | ## Inputs
35 |
36 | ## `ghost_hosted_url`
37 |
38 | **Required** Ghost hosted URL endpoint. (`ex: https://content.yourdomain.com/blog`)
39 |
40 | ## `ghost_static_host_url`
41 |
42 | **Required** URL endpoint where static files needs to be hosted. (`ex: https://yourdomain.com/blog`)
43 |
44 | ## `custom_replace_keys`
45 |
46 | **Optional** Comma separated list of items that needs to be replaced from the items in custom_replace_values at the same index.
47 |
48 | ## `custom_replace_values`
49 |
50 | **Optional** Comma separated associated values for the item in custom_replace_keys.
51 |
52 | ## `root_index_jsonld`
53 |
54 | **Optional** Replace ld+json data in the root index file.
55 |
56 |
57 | ## `breadcrumb_root_index_jsonld`
58 |
59 | **Optional** Add Breadcrumb ld+json data in the root index file.
60 |
61 | ## `s3_bucket_name`
62 |
63 | **Optional** S3 bucket name to upload static HTML files.
64 |
65 | ## `aws_access_key_id`
66 |
67 | **Optional** AWS access key Id.
68 |
69 | ## `aws_secret_access_key`
70 |
71 | **Optional** AWS secret access key.
72 |
73 | ## `aws_region`
74 |
75 | **Optional** AWS region.
76 |
77 | ## `aws_amplify_app_id`
78 |
79 | **Optional** Amplify App id.
80 |
81 | ## `aws_amplify_branch_name`
82 |
83 | **Optional** Amplify branch name.
84 |
85 | ## Example usage
86 |
87 | ```yaml
88 | name: Generate Static HTML files
89 | uses: TrueSparrowSystems/ghost-static-website-generator@v4
90 | with:
91 | ghost_hosted_url: "https://content.yourdomain.com/blog"
92 | ghost_static_host_url: "https://yourdomain.com/blog"
93 | s3_bucket_name: "your-s3-bucket-name"
94 | aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} # Accessing it from the gihub secrets
95 | aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # Accessing it from the gihub secrets
96 | aws_region: "us-east-1"
97 | custom_replace_keys: "key_1, key_2, key_n"
98 | custom_replace_values: "value_1, value_2, value_n"
99 | ```
100 |
101 | ### _Locally build and run with docker_
102 |
103 | ```bash
104 | docker build -t ghost-swg .
105 | docker run -it --env-file .env.sample ghost-swg
106 | ```
107 |
108 | > Make appropriate changes to the `.env.sample` file.
109 | > To Persist the generated HTML files in local (host system) directory, use bind mount option with `docker run` command, For example: `-v /path/to/local/dir:/src/content`
110 |
--------------------------------------------------------------------------------
/action.yml:
--------------------------------------------------------------------------------
1 | name: "Ghost Static Website Generator"
2 | description: "Generate static HTML files for custom ghost hosting and publish them on AWS S3 as static website"
3 | branding:
4 | icon: code
5 | color: orange
6 | inputs:
7 | ghost_hosted_url:
8 | description: "Ghost hosted URL endpoint"
9 | required: true
10 | ghost_static_host_url:
11 | description: "URL endpoint where static files needs to be hosted"
12 | required: true
13 | custom_replace_keys:
14 | description: "Comma separated list of items that needs to be replaced from the items in custom_replace_values at the same index"
15 | required: false
16 | custom_replace_values:
17 | description: "Comma separated associated values for the item in custom_replace_keys"
18 | required: false
19 | root_index_jsonld:
20 | description: "Replace ld+json data in the root index file"
21 | required: false
22 | breadcrumb_root_index_jsonld:
23 | description: "Add breadcrumb ld+json data to the root index file"
24 | required: false
25 | s3_bucket_name:
26 | description: "S3 bucket name to upload static HTML files"
27 | required: false
28 | aws_access_key_id:
29 | description: "AWS access key Id"
30 | required: false
31 | aws_secret_access_key:
32 | description: "AWS secret access key"
33 | required: false
34 | aws_region:
35 | description: "AWS region"
36 | required: false
37 | aws_amplify_app_id:
38 | description: "Amplify App id"
39 | required: false
40 | aws_amplify_branch_name:
41 | description: "Amplify Branch name"
42 | required: false
43 |
44 | runs:
45 | using: "docker"
46 | image: "Dockerfile"
47 | args:
48 | - ${{ inputs.ghost_hosted_url }}
49 | - ${{ inputs.ghost_static_host_url }}
50 | - ${{ inputs.custom_replace_keys }}
51 | - ${{ inputs.custom_replace_values }}
52 | - ${{ inputs.root_index_jsonld }}
53 | - ${{ inputs.breadcrumb_root_index_jsonld }}
54 | - ${{ inputs.s3_bucket_name }}
55 | - ${{ inputs.aws_access_key_id }}
56 | - ${{ inputs.aws_secret_access_key }}
57 | - ${{ inputs.aws_region }}
58 | - ${{ inputs.aws_amplify_app_id }}
59 | - ${{ inputs.aws_amplify_branch_name }}
60 |
--------------------------------------------------------------------------------
/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | if [[ $# -gt 0 && ${GITHUB_ACTIONS} -eq true ]]; then
4 | export GHOST_HOSTED_URL=${INPUT_GHOST_HOSTED_URL}
5 | export GHOST_STATIC_HOST_URL=${INPUT_GHOST_STATIC_HOST_URL}
6 | export CUSTOM_REPLACE_KEYS=${INPUT_CUSTOM_REPLACE_KEYS}
7 | export CUSTOM_REPLACE_VALUES=${INPUT_CUSTOM_REPLACE_VALUES}
8 | export ROOT_INDEX_JSONLD=${INPUT_ROOT_INDEX_JSONLD}
9 | export BREADCRUMB_ROOT_INDEX_JSONLD=${INPUT_BREADCRUMB_ROOT_INDEX_JSONLD}
10 | export S3_BUCKET_NAME=${INPUT_S3_BUCKET_NAME}
11 | export AWS_ACCESS_KEY_ID=${INPUT_AWS_ACCESS_KEY_ID}
12 | export AWS_SECRET_ACCESS_KEY=${INPUT_AWS_SECRET_ACCESS_KEY}
13 | export AWS_DEFAULT_REGION=${INPUT_AWS_REGION}
14 | export AWS_AMPLIFY_APP_ID=${INPUT_AWS_AMPLIFY_APP_ID}
15 | export AWS_AMPLIFY_BRANCH_NAME=${INPUT_AWS_AMPLIFY_BRANCH_NAME}
16 | fi
17 |
18 | /src/run.sh
19 |
--------------------------------------------------------------------------------
/run.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Following ENV variables are required.
4 | # - GHOST_STATIC_CONTENT_DIR (set in Dockerfile)
5 | # - GHOST_HOSTED_URL (something like "https://content.yoursite.com/blog")
6 | # - GHOST_STATIC_HOST_URL (something like "https://yoursite.com/blog")
7 | # Optional ENV variables:
8 | # - CUSTOM_REPLACE_KEYS (comma separated list of items that needs to be replaced from the items in CUSTOM_REPLACE_VALUES at the same index)
9 | # - CUSTOM_REPLACE_VALUES (associated values for the item in CUSTOM_REPLACE_KEYS)
10 | # - ROOT_INDEX_JSONLD (LD+JSON data that needs to be replaced in root index.html page)
11 | # - BREADCRUMB_ROOT_INDEX_JSONLD (Breadcrumb LD+JSON data that needs to be added in root index.html page)
12 | # - S3_BUCKET_NAME (S3 bucket name to upload static HTML files)
13 | # - AWS_ACCESS_KEY_ID
14 | # - AWS_SECRET_ACCESS_KEY
15 | # - AWS_DEFAULT_REGION
16 | # - AWS_AMPLIFY_APP_ID
17 | # - AWS_AMPLIFY_BRANCH_NAME
18 |
19 | GHOST_HOSTED_DOMAIN_WITH_PATH=$(echo ${GHOST_HOSTED_URL} | cut -d '/' -f 3-)
20 | GHOST_HOSTED_BLOG_PATH=$(echo ${GHOST_HOSTED_URL} | cut -d '/' -f 4-)
21 | GHOST_STATIC_BLOG_DOMAIN=$(echo ${GHOST_STATIC_HOST_URL} | cut -d '/' -f 3- | cut -d '/' -f 1)
22 | GHOST_STATIC_HOST=$(echo ${GHOST_STATIC_HOST_URL} | cut -d '/' -f 1-3)
23 | GHOST_STATIC_BLOG_PATH=$(echo ${GHOST_STATIC_HOST_URL} | cut -d '/' -f 4-)
24 |
25 | if [[ -z "${GHOST_HOSTED_URL}" ]]; then
26 | echo "Error: GHOST_HOSTED_URL is mandatory"
27 | exit 1
28 | fi
29 |
30 | if [[ -z "${GHOST_STATIC_HOST_URL}" ]]; then
31 | echo "Error: GHOST_STATIC_HOST_URL is mandatory"
32 | exit 1
33 | fi
34 |
35 | if [[ "${GHOST_HOSTED_BLOG_PATH}" != "${GHOST_STATIC_BLOG_PATH}" ]]; then
36 | echo "Error: Path mismatch. The ${GHOST_HOSTED_URL} and ${GHOST_STATIC_HOST_URL} should end with same path suffix."
37 | exit 1
38 | fi
39 |
40 | GHOST_HOSTED_URL_WITHOUT_PROTOCOL=$(echo -e ${GHOST_HOSTED_URL} | sed -e 's/^https://')
41 | GHOST_STATIC_HOST_URL_WITHOUT_PROTOCOL=$(echo -e ${GHOST_STATIC_HOST_URL} | sed -e 's/^https://')
42 |
43 | echo "###########################################################"
44 | echo "GHOST_HOSTED_URL : ${GHOST_HOSTED_URL}"
45 | echo "GHOST_HOSTED_URL_WITHOUT_PROTOCOL : ${GHOST_HOSTED_URL_WITHOUT_PROTOCOL}"
46 | echo "GHOST_HOSTED_BLOG_PATH : ${GHOST_HOSTED_BLOG_PATH}"
47 | echo "GHOST_STATIC_HOST_URL : ${GHOST_STATIC_HOST_URL}"
48 | echo "GHOST_STATIC_HOST_URL_WITHOUT_PROTOCOL : ${GHOST_STATIC_HOST_URL_WITHOUT_PROTOCOL}"
49 | echo "GHOST_STATIC_BLOG_DOMAIN : ${GHOST_STATIC_BLOG_DOMAIN}"
50 | echo "GHOST_STATIC_HOST : ${GHOST_STATIC_HOST}"
51 | echo "GHOST_STATIC_BLOG_PATH : ${GHOST_STATIC_BLOG_PATH}"
52 | echo "###########################################################"
53 |
54 | blog_dir="${GHOST_STATIC_CONTENT_DIR}"
55 | s3_blog_path="s3://${S3_BUCKET_NAME}"
56 | if [[ ! -z "${GHOST_STATIC_BLOG_PATH}" ]]; then
57 | blog_dir="${blog_dir}/${GHOST_STATIC_BLOG_PATH}"
58 | s3_blog_path="${s3_blog_path}/${GHOST_STATIC_BLOG_PATH}"
59 | fi
60 |
61 | if [[ -d ${blog_dir} ]]; then
62 | rm -rf ${blog_dir}/*
63 | fi
64 |
65 | echo " "
66 | echo "***** Started fetching static HTML files *****"
67 | WGET_PATHS=("/" "/sitemap.xml" "/sitemap.xsl" "/sitemap-authors.xml" "/sitemap-pages.xml" "/sitemap-posts.xml" "/sitemap-tags.xml" "/404/" "/public/ghost.css" "/public/ghost.min.css" "/public/404-ghost.png" "/public/404-ghost@2x.png")
68 | for path in ${WGET_PATHS[@]}; do
69 | url="${GHOST_HOSTED_URL}${path}"
70 | echo "Generating static HTML files for url : ${url}"
71 | wget --mirror -p --no-host-directories --timestamping --restrict-file-name=unix --page-requisites --content-on-error --no-parent --directory-prefix ${GHOST_STATIC_CONTENT_DIR} ${url}
72 | done
73 | echo "***** Fetch complete for static HTML files *****"
74 |
75 | find ${GHOST_STATIC_CONTENT_DIR} -name '*?v=*' -exec bash -c 'mv $0 ${0/?v=*/}' {} \;
76 |
77 | echo " "
78 | echo "***** Replace text with custom text started *****"
79 | declare -A REPLACE_CONTENT=(
80 | ["${GHOST_HOSTED_URL}"]="${GHOST_STATIC_HOST_URL}"
81 | ["${GHOST_HOSTED_URL_WITHOUT_PROTOCOL}"]="${GHOST_STATIC_HOST_URL_WITHOUT_PROTOCOL}"
82 | ["\"url\": \"${GHOST_STATIC_HOST_URL}/\""]="\"url\": \"${GHOST_STATIC_HOST}/\""
83 | ["\"@type\": \"WebSite\""]="\"@type\": \"WebPage\""
84 | )
85 |
86 | if [[ ! -z "${GHOST_STATIC_BLOG_PATH}" ]]; then
87 | REPLACE_CONTENT["${GHOST_STATIC_BLOG_DOMAIN}/${GHOST_STATIC_BLOG_PATH}\""]="${GHOST_STATIC_BLOG_DOMAIN}/${GHOST_STATIC_BLOG_PATH}/\""
88 | fi
89 |
90 | for rstring in "${!REPLACE_CONTENT[@]}"; do
91 | echo "Replace: ${rstring} -> ${REPLACE_CONTENT[${rstring}]}"
92 | find ${blog_dir} -type f -print0 | xargs -0 sed -i'' "s,${rstring},${REPLACE_CONTENT[${rstring}]},g"
93 | if [[ $? -ne 0 ]]; then
94 | echo "Error: Text replace failed"
95 | exit 1
96 | fi
97 | done
98 |
99 | IFS=',' read -r -a KEYS <<<"$CUSTOM_REPLACE_KEYS"
100 | IFS=',' read -r -a VALUES <<<"$CUSTOM_REPLACE_VALUES"
101 |
102 | if [[ ${#KEYS[@]} -ne ${#VALUES[@]} ]]; then
103 | echo "Error: Invalid environment variables CUSTOM_REPLACE_*. The number of comma separated items should be same in both the ENV variables."
104 | exit 1
105 | fi
106 |
107 | for i in "${!KEYS[@]}"; do
108 | key=$(echo -e ${KEYS[$i]} | sed -e 's/^[[:space:]]*//' | sed -e 's/[[:space:]]*$//')
109 | val=$(echo -e ${VALUES[$i]} | sed -e 's/^[[:space:]]*//' | sed -e 's/[[:space:]]*$//')
110 | echo "Custom Replace: ${key} -> ${val}"
111 | find ${blog_dir} -type f -print0 | xargs -0 sed -i'' "s,${key},${val},g"
112 | if [[ $? -ne 0 ]]; then
113 | echo "Error: Text replace failed"
114 | exit 1
115 | fi
116 | done
117 | echo "***** Text replace completed *****"
118 |
119 | if [[ ! -z "${ROOT_INDEX_JSONLD}" ]]; then
120 | echo " "
121 | echo "***** Replace ld+json data in index.html *****"
122 |
123 | sed "/" ${blog_dir}/index.html >${blog_dir}/_index.html
125 | mv -f ${blog_dir}/_index.html ${blog_dir}/index.html
126 |
127 | echo "***** ld+json data replaced in index.html *****"
128 | fi
129 |
130 |
131 | if [[ ! -z "${BREADCRUMB_ROOT_INDEX_JSONLD}" ]]; then
132 | echo " "
133 | echo "***** Adding Breadcrumb ld+json data in index.html *****"
134 |
135 | sed "/" ${blog_dir}/index.html >${blog_dir}/_index.html
137 | mv -f ${blog_dir}/_index.html ${blog_dir}/index.html
138 |
139 | echo "***** Breadcrumb ld+json data added in index.html *****"
140 | fi
141 |
142 | if [[ ! -z ${S3_BUCKET_NAME} ]]; then
143 | echo " "
144 | echo "***** Started uploading files to S3 *****"
145 | aws s3 sync ${blog_dir} ${s3_blog_path} --exclude 'public/*' --exclude 'assets/*' --acl public-read --cache-control "no-store, no-cache, max-age=0, must-revalidate, post-check=0, pre-check=0" --delete
146 | if [[ $? -ne 0 ]]; then
147 | echo "Error: S3 upload error"
148 | exit 1
149 | fi
150 | aws s3 sync ${blog_dir}/public ${s3_blog_path}/public --acl public-read --cache-control "public, max-age=604800, must-revalidate" --delete
151 | aws s3 sync ${blog_dir}/assets ${s3_blog_path}/assets --acl public-read --cache-control "public, max-age=604800, must-revalidate" --delete
152 | echo "***** S3 upload complete *****"
153 | elif [[ ! -z ${AWS_AMPLIFY_APP_ID} ]]; then
154 | echo ""
155 | echo "***** Started generating zip for static blog *****"
156 | cd ${GHOST_STATIC_CONTENT_DIR}
157 | zip -r ${GHOST_STATIC_BLOG_PATH}.zip ${GHOST_STATIC_BLOG_PATH}
158 | echo "***** Started create deployment for Amplify *****"
159 | job=`aws amplify create-deployment --app-id ${AWS_AMPLIFY_APP_ID} --branch-name ${AWS_AMPLIFY_BRANCH_NAME} --output json`
160 | # Extract values and store in variables
161 | jobId=$(echo "$job" | jq -r '.jobId')
162 | if [[ $? -ne 0 ]]; then
163 | echo "Error: Unable to fetch jobId"
164 | exit 1
165 | fi
166 | zipUploadUrl=$(echo "$job" | jq -r '.zipUploadUrl')
167 | if [[ $? -ne 0 ]]; then
168 | echo "Error: Unable to fetch zipUploadUrl"
169 | exit 1
170 | fi
171 | echo "jobId ===>>>>> ${jobId}"
172 | echo "zipUploadUrl ===>>>>> ${zipUploadUrl}"
173 | curl "${zipUploadUrl}" --upload-file ${GHOST_STATIC_BLOG_PATH}.zip
174 | if [[ $? -ne 0 ]]; then
175 | echo "Error: Unable to upload zip"
176 | exit 1
177 | fi
178 | aws amplify start-deployment --app-id ${AWS_AMPLIFY_APP_ID} --branch-name ${AWS_AMPLIFY_BRANCH_NAME} --job-id ${jobId}
179 | if [[ $? -ne 0 ]]; then
180 | echo "Error: Unable to start deployment"
181 | exit 1
182 | fi
183 | while true; do
184 | status=`aws amplify get-job --app-id ${AWS_AMPLIFY_APP_ID} --branch-name ${AWS_AMPLIFY_BRANCH_NAME} --job-id ${jobId} | jq -r '.job.summary.status'`
185 | if [[ $? -ne 0 ]]; then
186 | echo "Error: Unable to fetch status"
187 | exit 1
188 | fi
189 | # Check if the status is either "SUCCEED" or "FAILED"
190 | if [ "${status}" = "SUCCEED" ]; then
191 | echo "Job Status =>>>>>> ${status}"
192 | break
193 | elif [ "${status}" = "FAILED" ]; then
194 | echo "Job Status =>>>>>> ${status}"
195 | break
196 | elif [ "${status}" = "CANCELLED" ]; then
197 | echo "Job Status =>>>>>> ${status}"
198 | break
199 | else
200 | echo "Job Status =>>>>>> ${status}"
201 | fi
202 | # Wait for a while before checking again
203 | sleep 5 # Adjust the sleep duration as needed
204 | done
205 | else
206 | echo " "
207 | echo "If you want to upload the static site files to S3, provide following ENV variables: S3_BUCKET_NAME, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION"
208 | echo "Or if you want to upload the static site files to Amplify, provide following ENV variables: AWS_AMPLIFY_APP_ID, AWS_AMPLIFY_BRANCH_NAME, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION"
209 | fi
210 |
211 | echo " "
212 | echo "***** FINISHED SUCCESFULLY *****"
213 |
214 |
--------------------------------------------------------------------------------