Skip to content

Run the first release

Publish the site through the pipeline and verify the files, the headers and the page.

About 15 min · Verified 8 October 2026

0 of 5 steps done0%

Start it#

Release a change#

Open CodePipelinePipelinesshortlink-web-prod and choose Release change. This uses the newest commit on main, which includes your bucket edit.

Compare the commit shown in Source with GitHubyour forkCommits. The latest commit should be your chore(deploy): publish the website to my own bucket.

Watch the three stages#

StageWhat good looks likeTime
SourceGreen with your commit ID~20 s
BuildLog shows Tests 23 passed, then Vite's ✓ built in …, then UPLOAD_ARTIFACTS succeeded1 to 3 min
DeployWebLog shows upload: lines from aws s3 sync, then one upload: for index.htmlunder 1 min

In the DeployWeb log you should see lines like:

Expected outputExcerpt of the DeployWeb log
[Container] Running command aws s3 sync shortlink-web/dist/ s3://your-bucket/ --delete --region ap-south-1
upload: shortlink-web/dist/assets/index-AbC123.js to s3://your-bucket/assets/index-AbC123.js
delete: s3://your-bucket/assets/index-OldHash.js

Verify#

Check the bucket and the headers#

Your computerWhat is in the bucket now?
aws s3 ls s3://<WEB_BUCKET>/ --recursive --region ap-south-1 | tail -n 8

aws s3api head-object --region ap-south-1 --bucket <WEB_BUCKET> --key index.html \
  --query '{modified:LastModified,type:ContentType,cache:CacheControl}'

Replace <WEB_BUCKET> with your own value (or fill in the known ones once under My values at the top of the page).

You should see
modified is a few minutes ago (the pipeline wrote it), type is text/html and cache is no-cache. The listing shows index.html at the root and your files under assets/.

Check that the new build calls your API#

Your computerThe load balancer address must be inside the JavaScript
curl -s <WEB_URL>/ | grep -o 'assets/[^"]*\.js' | head -n 1

Replace <WEB_URL> with your own value (or fill in the known ones once under My values at the top of the page).

Take that path and fetch it:

Your computerSearch the bundle for the API host
curl -s <WEB_URL>/assets/<BUNDLE_FILE>.js | grep -c "<ALB_DNS>"

Replace <WEB_URL> <BUNDLE_FILE> <ALB_DNS> with your own value (or fill in the known ones once under My values at the top of the page).

The count must be 1 or more. If it is 0 the build ran without VITE_API_BASE_URL, so check the variable on shortlink-web-build.

Open the site#

Open <WEB_URL> in a private window or hard-refresh (Cmd Shift R or Ctrl Shift R).

You should see
The app loads and the badge says API online.
The pipeline ran, but the site did not change
  • You are seeing a cached page. Hard-refresh. index.html is no-cache, but a stale service worker or a proxy can still hold the old one.
  • DeployWeb wrote to a different bucket. Open the log and read the s3://… in the sync line. It must be <WEB_BUCKET>.
  • The build was cached. Look at the commit ID in Source. If it is not your latest, push again or choose Release change.
DeployWeb failed
  • AccessDenied on a bucket you do not recognise → the buildspec still points at the original bucket (see the Point the deploy file at your bucket chapter). Fix the file, push, release again.
  • AccessDenied on your bucket → the inline policy on codebuild-shortlink-web-deploy-service-role is missing or lists the wrong bucket name.
  • test -f shortlink-web/dist/index.html fails → the build artifact lacks the site. Open the Build action and check the artifacts section ran.
  • YAML_FILE_ERROR … deploy/buildspec-web-deploy.yml → the file is missing from the artifact. Check buildspec-web.yml lists it under artifacts.files.

Next: ship a change.

Found a mistake? Edit this page on GitHub.