原文链接: github action 更新 pages 发布release

上一篇: travis 自动 更新 github pages

下一篇: 利用github action下载 youtube 视频

action官方文档

https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions

使用 action 在push的时候, 同步更新 release 和 pages

release

https://github.com/softprops/action-gh-release

name: Release

on:
  push:
    tags:
      - 'v*.*.*'

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: install
        run: | 
            npm i
            npm run build
            
      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          files: ./dist/*
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pages

https://github.com/crazy-max/ghaction-github-pages

https://github.com/marketplace/actions/deploy-to-github-pages

name: CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Run  build and test
      run: echo  build and test
    - name: Run a multi-line script
      run: |
         npm i
         npm run build
         npm run test
         
         
  pages:
    runs-on: ubuntu-latest
    needs: [build]
    steps:
    - uses: actions/checkout@v2
    - name: post pages
      run: echo post pages
    - name: Run a multi-line script
      run: |
         npm i
         npm run build
         npm run pages 
    - name: GitHub Pages
      uses: crazy-max/ghaction-github-pages@v1.3.0
      with:
        build_dir: pages
    env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}



Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐