rancher/ui 使用GitHub Actions 自动生成release

举报
拿我格子衫来 发表于 2022/03/18 00:21:26 2022/03/18
【摘要】 可以用于自定义rancher的镜像使用  安装依赖包, 编译, 创建release,上传压缩包到release中 编译使用这个 会比较快一些 ./scripts/build-static -s 其实这个命令编译了两次,有点坑,一次是为了压缩包而编译,另外一次是为了环境部署编译   name: CI on:...

可以用于自定义rancher的镜像使用

 安装依赖包, 编译, 创建release,上传压缩包到release中

编译使用这个 会比较快一些

./scripts/build-static -s
 

其实这个命令编译了两次,有点坑,一次是为了压缩包而编译,另外一次是为了环境部署编译

 


  
  1. name: CI
  2. on:
  3. push:
  4. tags:
  5. - '*'
  6. # A workflow run is made up of one or more jobs that can run sequentially or in parallel
  7. jobs:
  8. # This workflow contains a single job called "build"
  9. build:
  10. # The type of runner that the job will run on
  11. runs-on: ubuntu-latest
  12. # Steps represent a sequence of tasks that will be executed as part of the job
  13. steps:
  14. # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
  15. - uses: actions/checkout@v2
  16. - name: Setup Node
  17. uses: actions/setup-node@v1
  18. with:
  19. node-version: '10.x'
  20. - name: Cache multiple paths
  21. uses: actions/cache@v2
  22. with:
  23. path: |
  24. ~/cache
  25. !~/cache/exclude
  26. **/node_modules
  27. key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
  28. - name: Install Dependencies
  29. run: ./scripts/update-dependencies
  30. - name: Build Static
  31. run: ./scripts/build-static -s
  32. - name: Create Release
  33. id: create_release
  34. uses: actions/create-release@v1
  35. env:
  36. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  37. with:
  38. tag_name: ${{ github.ref }}
  39. release_name: Release ${{ github.ref }}
  40. draft: false
  41. prerelease: false
  42. - name: Upload Release Asset
  43. id: upload-release-asset
  44. uses: actions/upload-release-asset@v1
  45. env:
  46. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  47. with:
  48. upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
  49. asset_path: dist/static/master-dev.tar.gz
  50. asset_name: ${{ github.ref }}.tar.gz
  51. asset_content_type: application/gzip

 

缓存可能用的有点问题, 好像并没有缓存起来.抽时间再查查API 优化一下

 第一个是上传的附件,二三是源码,创建release就会有

 

文章来源: fizzz.blog.csdn.net,作者:拿我格子衫来,版权归原作者所有,如需转载,请联系作者。

原文链接:fizzz.blog.csdn.net/article/details/107918216

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。