What you’ll learn

  • Validate the same static site.
  • Deploy it to S3 from GitHub Actions.
  • Use environments/secrets appropriately.

When you’re finished

  • Run the static-site workflow successfully.
  • Understand where deployment protection can be added.

Reuse jenkins-static-site-demo.

9.1 Validate the site

Use the same PowerShell validation script:

- name: Validate static site
  shell: pwsh
  run: ./scripts/Test-StaticSite.ps1

If the script exits non-zero, the job fails and later deployment steps do not run normally.

9.2 Deploy to S3

High-level flow:

push to main
   ↓
GitHub Actions
   ↓
Validate
   ↓
Authenticate to AWS
   ↓
aws s3 sync

Do not put AWS keys directly in the workflow file.

The complete workflow is in Appendix E.

9.3 Environments and protection

After the basic pipeline works, add a GitHub Environment such as:

production

Possible advanced protections include:

  • environment-specific secrets,
  • required reviewers where supported,
  • branch restrictions,
  • deployment history.

That turns a simple workflow into a more deliberate release process.