https://github.com/g-harel/website
personal website generator running in the cloud
https://github.com/g-harel/website
github personal-website
Last synced: 10 months ago
JSON representation
personal website generator running in the cloud
- Host: GitHub
- URL: https://github.com/g-harel/website
- Owner: g-harel
- License: mit
- Created: 2018-11-18T19:28:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-04T21:55:49.000Z (over 1 year ago)
- Last Synced: 2025-03-28T17:57:34.174Z (11 months ago)
- Topics: github, personal-website
- Language: Go
- Homepage: https://g.harel.page
- Size: 32.8 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# [g.harel.page](https://g.harel.page)
The page(s) are generated every five minutes by a [Cloud Function](https://cloud.google.com/functions/) which uploads the result to a public [Cloud Storage Bucket](https://cloud.google.com/storage/) whose contents are served by [Cloudflare](https://www.cloudflare.com/). Each build uses the contents of [.config](./.config) to build a [GraphQL](https://graphql.org/) query for the [GitHub API](https://developer.github.com/v4/). This data is then used to execute the website [templates](./templates) and build the static output files.
This process means the website contents, like user icon and repo descriptions, will always be up-to-date, without impacting response time. It also makes it easy, fast and version-controlled to update the list of projects and contributions shown on the website.
## Development
```
$ go run ./development/build.go
```
This command will output `index.html` in the project root and uses the local `.config` to fetch for data.
After the initial build, the `./templates` directory is watched for changes. Manual rebuilds can be triggered by typing `.\n`.
If a `.env` file exists in the project root, it will automatically be loaded.
The `GRAPHQL_TOKEN` environment variable must be defined to access the GitHub API.
## Deployment
To publish Go dependency changes outside the `./functions` directory, commit/push the changes and run `./scripts/update-function-deps.sh`.
This project's resources are all managed using [Terraform](https://www.terraform.io). Any change to the main branch will automatically be applied (using [Cloud Build](https://cloud.google.com/cloud-build)). However, some initial manual setup is required:
* A [Source Repository](https://cloud.google.com/source-repositories) must be connected to the GitHub project to act as a trigger for [Cloud Build](https://cloud.google.com/cloud-build).
* [Cloud Build](https://cloud.google.com/cloud-build)'s [Terraform](https://www.terraform.io) build step requires a [terraform cloud builder image](https://github.com/GoogleCloudPlatform/cloud-builders-community/tree/master/terraform) available in the project's [Container Registry](https://cloud.google.com/container-registry). Instructions available [here](https://github.com/GoogleCloudPlatform/cloud-builders-community#build-the-build-step-from-source).
_As of this writing (Nov 2018)_
* _[Default cloud function service account](https://cloud.google.com/functions/docs/concepts/iam#runtime_service_account) must have `Storage Object Admin` Role._
## License
[MIT](https://github.com/g-harel/website/blob/master/LICENSE)