侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 461 篇文章
  • 累计创建 184 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Github Workflows Demo

WinJay
2024-09-26 / 0 评论 / 0 点赞 / 12 阅读 / 2871 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。

Github Workflows Demo

name: weather-report # 工作流程名称,会在网页中进行显示

on:
  push:  # 为了调试方便,修改代码之后push上去即可以看到效果
    paths: # 指定只有哪些文件修改了才会触发该工作流程
      - weather-report/**
      - .github/workflows/weather-report.yml
  schedule: # 定时任务
    - cron: "0 0 * * *" # 每天 0 点跑 => 东八区 8点

jobs:
  weather-report:
    runs-on: "ubuntu-latest" # 在什么机器上跑
    env: # 设置的一些 secret,在 settings 中可以设置
      EMAIL_USERNAME: ${{ secrets.EMAIL_USERNAME }}
      EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
      TO: ${{ secrets.TO }}
    steps: # 指定的步骤
      - uses: actions/checkout@v2 
      - uses: actions/setup-go@v2  # 使用 golang 
        with:
          go-version: "^1.17" # 版本号
      - run: go run weather-report/main.go -eu $EMAIL_USERNAME -ep $EMAIL_PASSWORD -to $TO  # 指定的命令
0
  1. 支付宝打赏

    qrcode alipay
  2. 微信打赏

    qrcode weixin

评论区