Code Monkey home page Code Monkey logo

dwightgunning.com's Introduction

dwightgunning.com

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.

Development notes

Design system

The site is styled with Tailwindcss.

Images

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.

Maps

See the tiles readme.

CI/CD

Setup

Digital Ocean

  • 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.
References

Amazon Web Services

  • An AWS I&AM user authentication key
  • S3 Bucket
  • CloudFront Distribution

Local runs with nektos/act

Workflows can be run locally using act.

  1. Build the runner:
docker build -t act-runner:latest .github/act-runner
  1. 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.

  1. List the workflows:
act -l
  1. Run workflows. See the Workflow Reference.

GitHub Actions

GitHub Actions can be inspected and triggered via gh cli command.

gh workflow run

Upload to S3

aws s3 sync dist/ s3://staging.dwightgunning.com/ --exclude 'assets/maps/pmtiles*' --exclude 'assets/maps/fonts/*' --exclude 'assets/maps/sprites/\*' --delete

Invalidate CloudFront Distribution

aws cloudfront create-invalidation --distribution-id E1LBPVSBKVF447 --paths "/outdoors/_" "/\_astro/_"

Astro commands

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

dwightgunning.com's People

Contributors

dependabot[bot] avatar dwightgunning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.