name: CI on: - push - pull_request jobs: test: name: Test on Node.js ${{ matrix.node-version }} runs-on: ubuntu-20.04 strategy: matrix: node-version: [10, 12, 13, 14] steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # fetch all history to make `git describe` work - name: Setup Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - run: yarn install - run: yarn build - run: yarn bundle - run: yarn test - run: yarn lint publish-release: name: Publish to npmjs and GitHub Releases needs: [test] if: startsWith(github.ref, 'refs/tags/v') runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # fetch all history to make `git describe` work - run: sudo apt-get install asciidoctor pandoc - uses: actions/setup-node@v2 with: node-version: 14 registry-url: https://registry.npmjs.org - run: yarn install - name: Generate source tarball run: ./scripts/create-src-tarball dist/ipynb2html-${GITHUB_REF/refs\/tags\//}-src.tar.gz - run: yarn build - run: yarn bundle - name: Publish packages to npmjs run: yarn publish-all --non-interactive env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Upload tarballs to Releases uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: fail_on_unmatched_files: true files: | dist/*.tar.gz packages/ipynb2html-cli/dist/*.tar.gz packages/ipynb2html-cli/dist/*.zip deploy-viewer: name: Build and deploy viewer to ipynb.js.org needs: [test] if: github.ref == 'refs/heads/viewer' && github.event_name == 'push' # TODO: replace 'viewer' with 'master' runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # fetch all history to make `git describe` work - run: yarn install - name: Build ipynb-viewer run: BUILD_DESTDIR=$(pwd)/site yarn workspace ipynb2html-viewer build-site - name: Deploy to gh-pages uses: JamesIves/github-pages-deploy-action@releases/v3 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} BRANCH: gh-pages FOLDER: site CLEAN: true