1、前言
之前用node写了个程序,想要他每天定时执行,但是不想买云服务器也不想自己电脑当服务器天天开着机,无意中发现github可以实现该需求。
2、 github怎么实现
利用github Actions实现。
步骤:
1、程序上传到github,点击【Actions】

2、在该tab页中,向下滚动找到node相关的(我的是node的,按照自己实际代码找对应的)

3、点击 【Set up this workflow】按钮建立yml文件
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
schedule:
- cron: '0 1 * * *'
job