diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9870b84 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,49 @@ +name: CI +on: push +jobs: + build: + name: Build & test + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x, 14.x, 16.x, '*'] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - run: npm install --no-package-lock + - run: npm test + - run: npm run build-storybook --quiet + + - uses: actions/upload-artifact@v2 + # Only publish examples using the master branch, and only from one build + if: github.ref == 'refs/heads/master' && matrix.node-version == '16.x' + with: + name: examples + path: examples/* + if-no-files-found: error + + publish: + if: github.ref == 'refs/heads/master' + name: Deploy storybook examples + runs-on: ubuntu-latest + needs: build + + steps: + - uses: actions/checkout@v2 + + - uses: actions/download-artifact@v2 + with: + name: examples + path: examples + + - name: Deploy to gh-pages + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + branch: gh-pages + folder: examples diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 02332e5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js -node_js: - - '10' - -script: - - npm test - - npm run build-storybook - -deploy: - provider: pages - skip-cleanup: true - github-token: $GH_TOKEN - local_dir: examples - repo: httptoolkit/react-reverse-portal - target_branch: gh-pages - on: - branch: master \ No newline at end of file