-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use Github Actions to deploy website
- Loading branch information
1 parent
c1a7666
commit b760252
Showing
3 changed files
with
47 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters