update-jdk.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ## 利用GitHub Actions定时更新 jdk 镜像
  2. name: Update JDK
  3. # 两种触发方式:一、push代码,二、每天国际标准时间23点(北京时间+8即早上7点)运行
  4. on:
  5. push:
  6. branches:
  7. - error-understand # 不需要每次推送执行,所以选择error-understand分支
  8. # schedule:
  9. # - cron: '5 * * * *' # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows#scheduled-events-schedule
  10. workflow_dispatch:
  11. inputs:
  12. tags:
  13. description: 'Test scenario tags'
  14. required: true
  15. type: string
  16. # on:
  17. # schedule:
  18. # - cron: '*/5 * * * *' # 每5分钟一次,测试用
  19. jobs:
  20. bot:
  21. runs-on: ubuntu-latest # 运行环境为最新版的Ubuntu
  22. steps:
  23. - name: 'Checkout codes' # 步骤一,获取仓库代码
  24. uses: actions/checkout@v4
  25. with:
  26. ref: download_link
  27. - name: 'Run build' # 步骤二,执行sh命令文件
  28. run: |
  29. set -x
  30. ruby -v
  31. ls -lR
  32. cat jdk.rb
  33. bundle install
  34. ruby jdk.rb
  35. ls -lR jdk/
  36. - name: Deploy download_link
  37. uses: JamesIves/github-pages-deploy-action@v4
  38. if: github.event_name == 'push' && github.ref == 'refs/heads/download_link'
  39. with:
  40. # This is the branch where the docs are deployed to
  41. branch: download_link
  42. folder: ./