当前位置: 代码迷 >> 综合 >> rancher/ui 使用GitHub Actions 自动生成release
  详细解决方案

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

热度:31   发布时间:2024-02-09 04:16:36.0

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

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

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

./scripts/build-static -s

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

 

name: CIon: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 onruns-on: ubuntu-latest# Steps represent a sequence of tasks that will be executed as part of the jobsteps:# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it- uses: actions/checkout@v2- name: Setup Nodeuses: actions/setup-node@v1with:node-version: '10.x'- name: Cache multiple pathsuses: actions/cache@v2with:path: |~/cache!~/cache/exclude**/node_moduleskey: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}- name: Install Dependenciesrun: ./scripts/update-dependencies- name: Build Staticrun: ./scripts/build-static -s- name: Create Releaseid: create_releaseuses: actions/create-release@v1env:GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}with:tag_name: ${{ github.ref }}release_name: Release ${{ github.ref }}draft: falseprerelease: false- name: Upload Release Assetid: upload-release-assetuses: actions/upload-release-asset@v1env: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-stepsasset_path: dist/static/master-dev.tar.gzasset_name: ${{ github.ref }}.tar.gzasset_content_type: application/gzip

 

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

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

 

  相关解决方案