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

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

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

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

./scripts/build-static -s

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

 

name: CI

on:
  push:
    tags:
    - '*'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2

    - name: Setup Node
      uses: actions/setup-node@v1
      with:
          node-version: '10.x'

    - name: Cache multiple paths
      uses: actions/cache@v2
      with:
        path: |
          ~/cache
          !~/cache/exclude
          **/node_modules
        key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}

    - name: Install Dependencies
      run: ./scripts/update-dependencies

    - name: Build Static
      run: ./scripts/build-static -s

    - name: Create Release
      id: create_release
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: ${{ github.ref }}
        release_name: Release ${{ github.ref }}
        draft: false
        prerelease: false
    - name: Upload Release Asset
      id: upload-release-asset
      uses: actions/upload-release-asset@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        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
        asset_path: dist/static/master-dev.tar.gz
        asset_name: ${{ github.ref }}.tar.gz
        asset_content_type: application/gzip

 

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

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

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

拿我格子衫来

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值