Skip to content

Commit

Permalink
ci: use Github Actions to deploy website
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Mar 15, 2020
1 parent c1a7666 commit b760252
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 19 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Deploy

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install
run: npm install
- name: Run tests
run: npm test
- name: Build example
run: |
npm run example
mkdir _deploy
cp example/bundle.js example/index.html _deploy
- name: Publish site
if: success()
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: _deploy
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 12 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
language: node_js
node_js:
- "stable"
- "10"
- "8"

before_deploy:
- cd example && npm install && cd ..
- mkdir _deploy
- cp example/bundle.js example/index.html _deploy
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
local-dir: _deploy
on:
branch: master
node: stable
os: linux
dist: bionic
jobs:
include:
- name: Test on stable Node.js
node_js: stable
- name: Test on Node.js 12
node_js: 12
- name: Test on Node.js 10
node_js: 10
- name: Test on Node.js 8
node_js: 8
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "react-dailymotion-example",
"description": "React-Dailymotion example.",
"name": "react-vimeo-example",
"description": "@u-wave/react-vimeo example.",
"version": "0.0.0-example",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down

0 comments on commit b760252

Please sign in to comment.