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 paralleljobs: # 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就會有
最新評論