By the end of this lab, every git push to your main branch will automatically deploy your website to AWS S3. No manual upload. No "let me redeploy". Pure automation.
What you'll build:
- A GitHub repo containing a simple HTML/CSS site (or use your Week 1 portfolio)
- An S3 bucket configured for static website hosting
- An IAM user with limited permissions for GitHub to use
- A
.github/workflows/deploy.ymlfile that auto-deploys on every push - Bonus: a CloudFront distribution for a real custom domain feel
cloudwithshad-week3-site (or whatever you prefer)git clone https://github.com/YOUR-USERNAME/cloudwithshad-week3-site.gitindex.html file with simple content (or copy your Week 1 portfolio in)Here's a minimal index.html to get started:
Commit and push:
This is similar to Week 1 Lab 1 โ but quicker, because you've done it before.
cloudwithshad-week3-yourname-12345 (must be globally unique)index.html โ SaveSave the policy. Copy the Bucket website endpoint (from the Properties tab) โ looks like http://YOUR-BUCKET.s3-website-region.amazonaws.com. Save it.
GitHub Actions needs AWS credentials to deploy your site. We'll create a dedicated IAM user with the minimum permissions needed โ never share your personal AWS credentials!
github-actions-deployAmazonS3FullAccessAccess key ID and Secret access key. The secret is shown ONCE only.NEVER commit these AWS keys to git. NEVER share them publicly. If they leak, attackers can spin up servers on your account and bill you thousands. If you accidentally expose them, delete them immediately from IAM and create new ones.
In production, you'd use OIDC (OpenID Connect) to let GitHub assume an IAM role without storing keys. For learning, access keys are fine. We'll cover OIDC in the advanced course.
Now we tell GitHub about the AWS keys (securely!) and write the workflow file that runs on every push.
Step 4a โ Add the AWS keys as GitHub Secrets
- Open your GitHub repo
- Click Settings tab โ Secrets and variables โ Actions
- Click New repository secret
- Add three secrets, one at a time:
AWS_ACCESS_KEY_IDโ paste your access key IDAWS_SECRET_ACCESS_KEYโ paste your secret keyS3_BUCKETโ paste your bucket name (just the name, nos3://)
Step 4b โ Create the workflow file
In your local repo, create the file .github/workflows/deploy.yml (you'll need to create the .github/workflows/ folders first):
Save the file, then commit + push:
"When someone pushes to the main branch, spin up an Ubuntu runner. Check out the code. Configure AWS using the secrets I gave you. Then sync all the files to my S3 bucket โ except the .git folder, the workflow files, and any markdown files."
The moment of truth.
- Open your GitHub repo in the browser
- Click the Actions tab
- You should see your "Deploy to S3" workflow running (yellow circle) or completed (green check)
- Click into it to see live logs
- Once green, open the S3 bucket website URL from Phase 2 โ your site is live!
Now the magic test โ change something and push again:
Watch the Actions tab โ within 90 seconds, the workflow runs again. Refresh your S3 URL. The site updates automatically. No SSH. No FTP. No clicking "deploy" in any console.
Take a screenshot of: (1) the green checkmark in GitHub Actions, AND (2) the live S3 URL showing your updated content. Post both in the cohort WhatsApp group. Your shareable GitHub repo URL is your portfolio piece โ drop it on LinkedIn too. ๐
Hint: what to do when the workflow fails
Click into the failed run in the Actions tab. The error is at the bottom of the logs. Most common issues:
- Access Denied: Bucket policy not set, or IAM user missing S3 permissions
- Invalid credentials: Secret was pasted with extra spaces. Re-add it carefully.
- Bucket not found: Region in workflow YAML doesn't match where the bucket lives
- Workflow didn't run at all: Wrong path โ must be
.github/workflows/, all lowercase, no typos
S3 buckets in the free tier cost almost nothing, but it's good hygiene. Also: rotate your access keys.
- Empty the S3 bucket, then Delete the bucket
- Delete the IAM user (IAM โ Users โ github-actions-deploy โ Delete)
- OR rotate the keys: if you want to keep the pipeline working, just delete the old access key and create a new one โ update the GitHub Secret
- Keep the GitHub repo! โ it's a portfolio piece
This is genuinely employer-impressive. Add it to your LinkedIn under Projects with the line: "Built a CI/CD pipeline that auto-deploys to AWS using GitHub Actions and S3." Employers love seeing this.
Lab 6 complete!
You just built the same CI/CD pattern used by Fortune 500 companies. Every push to main = automatic deploy. This is what makes "ship fast" possible.
Next week: AI services + capstone โ Textract, Comprehend, and your final project