Skip to content

GitHub branches and CI

  1. Create amplify-astro-cicd under your user or org (private or public)
  2. Push your local scaffold as main
Terminal window
git init -b main
git add .
git commit -m "feat: scaffold minimal astro sample for amplify
Initial Astro app with amplify.yml for Hosting builds."
git remote add origin git@github.com:<org>/amplify-astro-cicd.git
git push -u origin main
Terminal window
git checkout -b staging
git push -u origin staging
git checkout main

Amplify will use both branch names later. Feature work always starts from a new branch off staging or main and opens a PR into staging first.

Add .github/workflows/ci.yml:

name: CI
on:
pull_request:
push:
branches: [main, staging]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- run: npm ci
- run: npm run build

This is the CI gate
GitHub Actions checks plus branch protection - required before merge. Amplify does not wait for CI by itself; it builds on push.
Amplify will not enforce for you.

On staging and main:

  • Require a pull request before merging
  • Require the CI workflow to pass
  • Disallow force pushes

Next: Create Amplify app.