Planning applications tracker for InLinkUK from BT kiosks. https://kiosks.adrianshort.org/
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

README.md 2.6 KiB

6 år sedan
6 år sedan
6 år sedan
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # [kiosks.adrianshort.org](https://kiosks.adrianshort.org/)
  2. Static site generator for website to track BT InLink kiosks planning applications.
  3. [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/adrianshort/kiosks)
  4. ## How to build this site locally
  5. ### Setup - do this only once
  6. 1. `$ git clone git@github.com:adrianshort/kiosks.git && cd kiosks`
  7. 2. `$ bundle install`
  8. 3. [Sign in to Morph](https://morph.io/users/auth/github) with your GitHub account.
  9. 4. Go to your Settings page: https://morph.io/owners/YOUR-USERNAME/settings and copy your secret API key.
  10. 5. `$ export MORPH_API_KEY=123456abcdef` (use the actual key value given)
  11. Add the `MORPH_API_KEY` to your `.profile` or `.bash_profile` file or similar as required so it's available for every shell session.
  12. ### Build - do this every time
  13. 1. `$ bundle exec bin/download` - gets the latest data from the scraper's API
  14. 2. `$ bundle exec bin/petrify` - builds the static site
  15. The built site is now in the `_site` directory.
  16. If you've got build/deploy to Netlify set up (see below), use `[skip ci]` in your commit messages to avoid triggering a build every time you `git push`.
  17. ## How to build and deploy this site on Netlify
  18. Use Morph to send a webhook HTTP POST request to [Netlify](https://www.netlify.com/), triggering Netlify to build and deploy the site using the latest version of the data.
  19. ### Basic setup
  20. 1. Sign in to Netlify.
  21. 2. Click `New site from Git`
  22. 3. Connect your GitHub account.
  23. 4. Choose the `adrianshort/kiosks` repo to deploy, or your own fork of it.
  24. 5. Use these settings: Branch to deploy: `master`, build command: `bundle exec bin/download && bundle exec bin/petrify`, publish directory: `_site`
  25. 6. Click `Show advanced` and create a `New variable`
  26. 7. Key: `MORPH_API_KEY`, Value: `123456abcdef` (use the actual key value given by Morph)
  27. 8. Click `Deploy`. Netlify will now build and deploy the site.
  28. ### Set up a webhook to trigger automatic builds/deploys when the scraper finishes
  29. 1. Click `Site settings` for your Netlify site.
  30. 2. `Build & deploy` tab > `Continuous Deployment`
  31. 3. Click `Add build hook`.
  32. 4. `Build hook name` can be anything you like, eg `Morph scrape completed`.
  33. 5. `Branch to build` is `master`.
  34. 6. Click `Save`.
  35. 7. Copy the webhook URL, eg: `https://api.netlify.com/build_hooks/123456abcdef`.
  36. 8. On Morph, go to the Settings page for your scraper.
  37. 9. Click `Add webhook`.
  38. 10. Paste the webhook URL and click `Update Settings`.
  39. Netlify will now build and deploy the site using the latest scraper data every time the Morph scrape succeeds.