This commit is contained in:
Niklas von Hertzen 2020-08-02 15:49:02 +08:00 committed by GitHub
parent e496047888
commit 3c2c826ad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ on:
push: push:
branches: [ master ] branches: [ master ]
tags: tags:
- 'test*' - 'v*'
pull_request: pull_request:
branches: [ master ] branches: [ master ]
@ -173,13 +173,19 @@ jobs:
publish: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Publish name: Publish
if: startsWith(github.ref, 'refs/tags/test') if: startsWith(github.ref, 'refs/tags/v')
needs: browser-test needs: browser-test
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: 12 node-version: 12
registry-url: 'https://npm.pkg.github.com'
- name: Download NPM package
uses: actions/download-artifact@v2
with:
name: npm
path: npm
- name: Download library - name: Download library
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
with: with:
@ -222,6 +228,12 @@ jobs:
asset_path: ./dist/html2canvas.esm.js asset_path: ./dist/html2canvas.esm.js
asset_name: html2canvas.esm.js asset_name: html2canvas.esm.js
asset_content_type: text/javascript asset_content_type: text/javascript
- name: Unpack npm
run: cd npm && tar -xvzf "html2canvas.tgz"
- name: NPM Publish (github)
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docs: docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Build docs name: Build docs
@ -275,7 +287,7 @@ jobs:
publish-docs: publish-docs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: Publish Docs name: Publish Docs
if: ${{ github.ref == 'refs/heads/master' }} if: ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v') }}
needs: docs needs: docs
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
@ -290,7 +302,7 @@ jobs:
uses: JamesIves/github-pages-deploy-action@3.5.9 uses: JamesIves/github-pages-deploy-action@3.5.9
with: with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages-test BRANCH: gh-pages
FOLDER: docs FOLDER: docs
SINGLE_COMMIT: true SINGLE_COMMIT: true
CLEAN: true CLEAN: true