{"id":19042502,"url":"https://github.com/serverless/post-scheduler","last_synced_at":"2025-06-19T07:10:22.713Z","repository":{"id":65982487,"uuid":"82608997","full_name":"serverless/post-scheduler","owner":"serverless","description":"Schedule posts \u0026 content updates for static websites (Jekyll, Hugo, Gatsby, Phenomic etc)","archived":false,"fork":false,"pushed_at":"2023-11-27T14:45:16.000Z","size":38,"stargazers_count":197,"open_issues_count":3,"forks_count":13,"subscribers_count":32,"default_branch":"master","last_synced_at":"2024-11-08T22:40:37.696Z","etag":null,"topics":["gatsby","hexo","hugo","jekyll","phenomic","scheduler","serverless","static-site-generator"],"latest_commit_sha":null,"homepage":"https://serverless.com/blog/static-site-post-scheduler/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-20T22:27:20.000Z","updated_at":"2024-11-05T19:18:08.000Z","dependencies_parsed_at":"2024-11-08T22:38:14.588Z","dependency_job_id":"5c4a7dc7-ff92-4585-aa34-c42f25840661","html_url":"https://github.com/serverless/post-scheduler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fpost-scheduler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fpost-scheduler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fpost-scheduler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fpost-scheduler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless","download_url":"https://codeload.github.com/serverless/post-scheduler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224880427,"owners_count":17385370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gatsby","hexo","hugo","jekyll","phenomic","scheduler","serverless","static-site-generator"],"created_at":"2024-11-08T22:38:03.367Z","updated_at":"2024-11-16T06:05:54.510Z","avatar_url":"https://github.com/serverless.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"415\" height=\"204\" src=\"https://cloud.githubusercontent.com/assets/532272/23386639/779ce26c-fd0c-11e6-9e54-f33281e17719.jpg\"\u003e\n\u003c/p\u003e\n\n# Static Site Post Scheduler\n\nThe post scheduler is a [serverless](https://github.com/serverless/serverless) project that gives static site owners the ability to schedule posts (or other site content).\n\nIt works with any static site setup (Jekyll, Hugo, Phenomic, Gatsby etc.)\n\n[Video demo](https://www.youtube.com/watch?v=YETxuhexZY4\u0026index=1\u0026list=PLIIjEI2fYC-BubklemD4D51vrXHOcUOpc\u0026t=31s)\n\n## How does it work?\n\n\u003cimg align=\"right\" width=\"500\" height=\"313\" src=\"https://cloud.githubusercontent.com/assets/532272/23643861/250f2ca0-02b9-11e7-9a1b-94676043f2aa.gif\"\u003e\n\n1. A github webhook fires when pull requests (aka new posts) are updated.\n\n2. If the pull request comment has a comment matching `schedule(MM/DD/YYYY H:MM pm)` and the person is a collaborator on the project, the post gets scheduled for you.\n\n3. A serverless cron job runs every hour to check if a post is ready to be published\n\n4. When the post is ready to be published, the cron function automatically merges the branch into `master` and your site, if you have CI/CD built in, will redeploy itself.\n\nTo cancel scheduled posts, delete the scheduled comment and it will unschedule the branch.\n\n### Github Webhook Architecture Overview\n\n![cloudcraft - post scheduler webhook](https://cloud.githubusercontent.com/assets/532272/23387076/2e7960b2-fd0f-11e6-88da-49517b27d8ae.png)\n\n### Cron Job Architecture Overview\n\n![cloudcraft - post scheduler cron setup](https://cloud.githubusercontent.com/assets/532272/23388042/e129772e-fd14-11e6-96ca-ff23a019a51e.png)\n\n## Install Instructions\n\nYou will need the [serverless framework installed and an AWS account configured](https://github.com/serverless/serverless#quick-start) on your computer to deploy this for your repo.\n\n```bash\nnpm install serverless -g\n```\n\nThen [watch the scheduler setup and usage videos](https://www.youtube.com/watch?v=YETxuhexZY4\u0026index=1\u0026list=PLIIjEI2fYC-BubklemD4D51vrXHOcUOpc) or follow the instructions below.\n\n1. Clone down the repository and run `npm install` to instal the dependencies\n\n2. Duplicate `config.prod.example.json` into a new file called `config.prod.json` and insert your Github username, API token, and webhook secret\n\n\n  ```json\n  // config.prod.json\n  {\n    \"serviceName\": \"blog-scheduler\",\n    \"region\": \"us-west-2\",\n    \"TIMEZONE\": \"America/Los_Angeles\",\n    \"CRON\": \"cron(0 * * * ? *)\",\n    \"GITHUB_REPO\": \"serverless/blog\",\n    \"GITHUB_WEBHOOK_SECRET\": \"YOUR_GITHUB_WEBHOOK_SECRET_HERE\",\n    \"GITHUB_API_TOKEN\": \"YOUR_GITHUB_API_TOKEN_HERE\",\n    \"GITHUB_USERNAME\": \"YOUR_GITHUB_USERNAME_HERE\"\n  }\n  ```\n\n  - `serviceName` - name of the service that will appear in your AWS account\n  - `region` - AWS region to deploy the functions and database in\n  - `TIMEZONE` - Timezone the cron runs on. See `timezone.json` for available options\n  - `CRON` - How often you want to check for scheduled posts? See the [AWS cron docs](http://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html) or [serverless `schedule` docs](https://serverless.com/framework/docs/providers/aws/events/schedule/) for more information. **Default:** every hour on the hour\n  - `GITHUB_REPO` - The `owner/repoName` of your repository\n  - `GITHUB_WEBHOOK_SECRET` - Any string you want. This gets plugged into your webhook settings\n  - `GITHUB_API_TOKEN` - Personal access token. See below for additonal info\n  - `GITHUB_USERNAME` - Your github username. Used for requests to github\n\n\n3. Deploy the service with `serverless deploy`. If you need to setup serverless, please see [these install instructions](https://github.com/serverless/serverless#quick-start).\n\n4. Take the POST endpoint returned from deploy and plug it into your [repositories settings in github](https://youtu.be/b_DVXgiByec?t=1m9s)\n\n  ![image](https://cloud.githubusercontent.com/assets/532272/23144203/e0dada50-f77a-11e6-8da3-7bdbcaf8f2a0.png)\n\n  1. Add your github webhook listener URL into the `Payload URL` and choose type `application/json`\n\n  2. Plugin your `GITHUB_WEBHOOK_SECRET` defined in your config file\n\n  3. Select which github events will trigger your webhook\n\n  4. Select Issue comments, these will be where you insert `schedule(MM/DD/YYYY H:MM pm)` comments in a given PR\n\n5. Submit a PR and give it a go!\n\n## Contributions Welcome\n\nHave an idea on how we can improve the static site post scheduler?\n\n[Submit a PR](https://github.com/serverless/post-scheduler/), post an issue or tweet [@DavidWells](https://twitter.com/davidwells)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless%2Fpost-scheduler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless%2Fpost-scheduler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless%2Fpost-scheduler/lists"}