Skip to content

Commit 6e1179b

Browse files
committed
build & deploy og github actions
1 parent 0e9f200 commit 6e1179b

File tree

5 files changed

+91
-6
lines changed

5 files changed

+91
-6
lines changed

.github/workflows/build.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: vscroll-native build
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
branches: [ main ]
9+
workflow_dispatch:
10+
inputs:
11+
cause:
12+
description: 'Cause'
13+
required: true
14+
default: 'Manual triggering'
15+
16+
jobs:
17+
build-and-deploy:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
node-version: [12.x]
22+
steps:
23+
24+
- name: Dispatched?
25+
if: ${{ github.event_name == 'workflow_dispatch' }}
26+
run: |
27+
echo "This is dispatched"
28+
echo "Build reason: ${{ github.event.inputs.cause }}"
29+
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Use Node.js ${{ matrix.node-version }}
34+
uses: actions/setup-node@v1
35+
with:
36+
node-version: ${{ matrix.node-version }}
37+
38+
- run: npm install
39+
- run: npm test
40+
- run: npm run build
41+
- run: npm run build-app
42+
43+
- name: Set output (branch name)
44+
id: vars
45+
run: echo ::set-output name=branch::${GITHUB_REF#refs/*/}
46+
47+
- name: Skip Deploy?
48+
if: ${{ github.event_name != 'push' || steps.vars.outputs.branch != 'main' }}
49+
run: |
50+
echo "Only pushing to 'main' causes deploy automatically. Pushed to '${{ steps.vars.outputs.branch }}'"
51+
52+
- name: Deploy
53+
if: ${{ github.event_name == 'push' && steps.vars.outputs.branch == 'main' }}
54+
uses: JamesIves/github-pages-deploy-action@4.1.0
55+
with:
56+
branch: gh-pages
57+
folder: dist-demo

.github/workflows/deploy-manual.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: vscroll-native manual deploy demo
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
cause:
7+
description: 'Cause of run'
8+
required: true
9+
default: 'Manual triggering'
10+
11+
jobs:
12+
13+
deploy-on-dispatch:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout 🛎️
17+
uses: actions/checkout@v2.3.1
18+
19+
- name: Install and Build 🔧
20+
run: |
21+
npm install
22+
npm run build-app
23+
24+
- name: Deploy 🚀
25+
uses: JamesIves/github-pages-deploy-action@4.1.0
26+
with:
27+
branch: gh-pages
28+
folder: dist-demo

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"jest": "jest --watch",
3030
"jest:singlerun": "jest",
3131
"test": "npm run lint && npm run jest:singlerun",
32-
"prepare": "npm run test && npm run build"
32+
"prepublishOnly": "npm run test && npm run build"
3333
},
3434
"dependencies": {
3535
"vscroll": "^1.0.0-rc.8"

src/version.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export default {
22
name: 'vscroll-native',
3-
version: '1.0.0-beta.2'
3+
version: '1.0.0-beta.3'
44
};

0 commit comments

Comments
 (0)