The project source and CI/CD for www.dwightgunning.com.
A static site built with Astro.build and GitHub actions, hosted on AWS with Route53+CloudFront+S3.
The site is styled with Tailwindcss.
tailwind.config.cjs
tailwindBase.css
- color palette
ImageMagick mogrify
is good for converting original photos from various formats to jpegs with minimal quality loss. The Astro assets can then take care of generating web optimized images.
See the tiles readme.
- Personal Access Token. Enables the
doctl
command to authenticate and perform actions with Digital Ocean resources. Setup here. - SSH key pair. Enables setup of SSH Key-Based Authentication on new Droplets. Setup here.
- Project identifier. Identifiable via
doctl projects list
.
- Digital Ocean Slugs: Identifiers for droplet, distro/app images, regions, etc.
- doctl Command Line Interface docs
- An AWS I&AM user authentication key
- S3 Bucket
- CloudFront Distribution
Workflows can be run locally using act.
- Build the runner:
docker build -t act-runner:latest .github/act-runner
- Configure the workflow environment, variables and secrets. See the
.templates
in.act/
.
a. Create an SSH key pair. Then setup Digital Ocean with the public key for SSH Key-Based Authentication
ssh-keygen -f $(pwd)/.act/id_rsa && chmod 600 $(pwd)/.act/id_rsa
b. Create an AWS I&AM User with permissions to access the bucket. Generate an access key; retrieve the access key id and secret.
- List the workflows:
act -l
- Run workflows. See the Workflow Reference.
GitHub Actions can be inspected and triggered via gh
cli command.
gh workflow run
aws s3 sync dist/ s3://staging.dwightgunning.com/ --exclude 'assets/maps/pmtiles*' --exclude 'assets/maps/fonts/*' --exclude 'assets/maps/sprites/\*' --delete
aws cloudfront create-invalidation --distribution-id E1LBPVSBKVF447 --paths "/outdoors/_" "/\_astro/_"
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
yarn install |
Installs dependencies |
yarn dev |
Starts local dev server at localhost:3000 |
yarn build |
Build your production site to ./dist/ |
yarn preview |
Preview your build locally, before deploying |
yarn astro ... |
Run CLI commands like astro add , astro preview |
yarn astro --help |
Get help using the Astro CLI |