Skip to content

janaka/blog-janaka-dev

Repository files navigation

Personal blog by Janaka Abeywardhana. Thoughts and notes on web technology, software development, and technical product managenement.

The main version at https://janaka.dev is hosted traditionally. A mirror at https://ipfs.janaka.dev is hosted on IPFS. A key reason for creating this site and using a static site generator was to host on IPFS as a learning exercise (web3). I've not managed to get IPFS hosting working reliably. So for now web2 hosting until I figure it out.

Forked from Gatsby blog starter. Help and inspiration from overreacted.io by Dan Abramov. Syntax theme based on Sarah Drasner's Night Owl with small tweaks. Copied from overreacted.io.

Contributions

No third-party contributions except for code and content fixes. PRs welcome.

Supported languages in code blocks

  • Push to master on Github triggers the deploy workflow on fleek.co

Deploy to traditional hosting https://janaka.dev

  • Push to master on Github triggers the deploy workflow on Github actions

To run locally

Deploy to IPFS manually from local

This is not the preferred option.

  • yarn build Note: This command wraps gatsby build
  • cd blog-janaka-dev
  • ipfs add -r public
  • (One off step) create custome key ipfs key gen --type=rsa -size=2048 blog-janaka-dev Should return a $PEER_ID
  • (one off step) create TLS cert?
  • ipfs name publish --key=blog-janaka-dev $CID $CID is the content ID from the add step Should return Published to $PEER_ID: /ipfs/$CID

refs: https://docs-beta.ipfs.io/how-to/host-single-page-site/#create-your-site

Deploy to S3 hosting from local

This is not the preferred option. Use this only if local testing of CI/CD is require for troubleshooting

  • Add the following to a .env file

    AWS_S3_BUCKET_NAME=<bucket name>
    AWS_REGION=<aws region>
    AWS_PROFILE=<aws credentials profile name>
  • yarn build

  • yarn deploy

Setup