Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/karllhughes/workers-codeship-example
Use Codeship to automatically update your Cloudflare Workers
https://github.com/karllhughes/workers-codeship-example
Last synced: about 1 month ago
JSON representation
Use Codeship to automatically update your Cloudflare Workers
- Host: GitHub
- URL: https://github.com/karllhughes/workers-codeship-example
- Owner: karllhughes
- Created: 2018-08-24T14:04:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-24T20:58:14.000Z (over 6 years ago)
- Last Synced: 2024-08-03T03:03:45.957Z (4 months ago)
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Cloudflare Workers Codeship Example
====[Cloudflare Workers](http://developers.cloudflare.com/workers/) allow you to write JavaScript which runs on all of Cloudflare's
160+ global data centers. This repo is an example of how to combine multiple files and dependencies to create a Worker using
the [Webpack](https://webpack.js.org/) build tool.The actual Worker replaces the content of your site with a Worker which returns the current time in the timezone of the caller's
choice.This project is [adapted from Cloudflare's Webpack example](https://github.com/cloudflare/workers-webpack-example).
### Dependencies
- [npm](https://www.npmjs.com/get-npm)
- [jq](https://stedolan.github.io/jq/) (for the preview script)
- [cURL](https://curl.haxx.se/) (for the preview script)### Instructions
- `npm install`
- `npm run build`To open the Workers preview with the built Worker:
- `npm run preview`
### Automated Deployment
You can use Codeship to automatically update your Worker. Just add the following environment variables to your Codeship environment:
- `CLOUDFLARE_EMAIL`
- `CLOUDFLARE_AUTH_KEY`
- `CLOUDFLARE_ZONE_ID`Codeship will automatically update your worker in Cloudflare when the `master` branch is built using the script at `scripts/deploy`.