Skip to content

rawilk/randallwilk.dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

497 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The source code of randallwilk.dev

Tests Laravel Forge Site Deployment Status

This repo contains the source code of my personal website.

Local Development

All development should be done on or PR'd to the develop branch. Treat the main and stage branches as readonly.

To work on this project on your local machine, you may follow the instructions below. These instructions assume you are serving the site using Laravel Valet or Herd out of your ~/Sites directory:

Requirements

Be sure the following are installed on your machine:

  • Composer
  • PHP >= 8.3
  • PostgreSQL >= 16
  • Node >= 18
  • Redis for queues/cache
  • (Optional) A GitHub OAuth app for your local installation for social login

Installation

cd ~/Sites

# Clone your forked version - replace {username} with your username
git clone git@github.com:{username}/randallwilk.dev randallwilk.dev

cd randallwilk.dev

# Run the bash setup script
./bin/setup.sh

Note: Be sure to fill out GitHub credentials in the .env to import docs (optional).

Note: The repositories database table is only populated by running the php artisan import:github-repositories command, and the repositories pulled in are based on your GitHub credentials in the .env file.

Docs

Docs can be imported from the artisan command, as long as you have Laravel Horizon running and the credentials for the GitHub api filled in. It also requires you to have read access to each of the repositories that have docs (I don't think that should be an issue since they're all public).

php artisan import:docs

Syncing Upstream Changes Into Your Fork

This GitHub article provides instructions on how to pull the latest changes from this repository into your fork.

Updating After Remote Code Changes

If you pull down the upstream changes from this repository into your local repository, you'll want to update your Composer and NPM dependencies. For convenience, you may run the bin/update-deps.sh script to update these things:

./bin/update-deps.sh

Commands

Command Description
npm run dev Watch for changes in CSS and JS files
php artisan test Run tests
php artisan import:docs Import doc files
php artisan import:github-repositories Sync public repo info with GitHub
php artisan import:packagist-downloads Sync download stats for composer packages
php artisan sitemap:generate Regenerate sitemaps
php artisan app:refresh-staging-data Sync staging database with production; only available to run in production environment
php artisan app:redact-sensitive-data Redact sensitive information from certain tables; not allowed to run in production environment

Deployment

Deployments for the main and stage branch are handled through GitHub actions that will handle generating a fresh copy of the .env file with secrets from my 1Password vault. The action will send the fresh copy to the server and trigger a deployment through Forge.

A deployment to the production and staging environments can only be triggered manually by dispatching the GitHub workflow, which requires the correct access permissions to the repository.

Secrets

For the GitHub actions workflow deploy.yml to work correctly, the following repository secrets are defined for the production and staging environments.

Secret Description
FORGE_TRIGGER_URL The deployment trigger URL for the site in Laravel Forge
KNOWN_HOSTS The server ip and public keys. Can find this info in known_hosts file after connecting the server via ssh.
OP_SERVICE_ACCOUNT_TOKEN 1Password service account token to connect the environment's vault and 1Password secrets
REMOTE_HOST The server ip address
REMOTE_TARGET The full path to the production site on the server, e.g /home/user_name/randallwilk.dev
REMOTE_USER The linux user that owns the site on the server, e.g forge.
SSH_KEY The private ssh key for the linux user that owns the site. Be sure to add the public key to the server in Forge. Note: do not add a passphrase to the private key.

Credits

This website was principally designed and developed by Randall Wilk.

License

If you'd like to reuse or repost something, feel free to reach out at randall@randallwilk.dev. Please remember that the design is not meant to be forked!

About

Repo for my personal site.

Topics

Resources

Stars

Watchers

Forks

Contributors