Planning applications tracker for InLinkUK from BT kiosks. https://kiosks.adrianshort.org/
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

README.md 2.7 KiB

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