gh-pages.yml 2.1 KB
Newer Older
B
baiy 已提交
1 2 3 4 5 6 7 8 9 10 11 12
name: Build to gh-pages
on:
  push:
    branches:
      - master
jobs:
  deploy:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [14.x]
    steps:
B
update  
baiy 已提交
13 14 15
      - name: Checkout
        uses: actions/checkout@v2

B
baiy 已提交
16 17 18 19
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
B
update  
baiy 已提交
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

      - name: Initialize / Install Dependencies
        run: |
          mkdir temp_release
          npm install

      - name: Build web
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=web
          cp -r ./dist ./dist_gh_pages
          cd ./dist
          zip -r -q ../temp_release/web.zip ./*
          cd ../
          unzip -l ./temp_release/web.zip

      - name: Build chrome
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=chrome
          cd ./dist
          zip -r -q ../temp_release/chrome.zip ./*
          cd ../

      - name: Build utools
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=utools
          cd ./dist
          zip -r -q ../temp_release/utools.zip ./*
          cd ../

      - name: Build edge
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=edge
          cd ./dist
          zip -r -q ../temp_release/edge.zip ./*
          cd ../

      - name: Build firefox
        if: startsWith(github.ref, 'refs/tags/')
        run: |
          npm run build -adapter=firefox
          cd ./dist
          zip -r -q ../temp_release/firefox.zip ./*
          cd ../

      - name: upload build to github
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            web.zip
            chrome.zip
            utools.zip
            edge.zip
            firefox.zip

      - name: Deploy web to gh-pages
        if: startsWith(github.ref, 'refs/tags/')
B
baiy 已提交
81 82 83
        uses: peaceiris/actions-gh-pages@v3
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
B
update  
baiy 已提交
84
          publish_dir: ./dist_gh_pages