Skip to content

Commit eac962c

Browse files
committed
Add github actions workflows
1 parent 1351b40 commit eac962c

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/deploy-demo.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and Deploy Demo
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
jobs:
7+
build-and-deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v2.3.1 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
12+
with:
13+
persist-credentials: false
14+
15+
- name: Install and Build 🔧
16+
run: |
17+
npm install
18+
npm run build:demo:github
19+
cp dist/demo/index.html dist/demo/404.html
20+
21+
- name: Deploy 🚀
22+
uses: JamesIves/github-pages-deploy-action@3.6.2
23+
with:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
BRANCH: gh-pages # The branch the action should deploy to.
26+
FOLDER: dist/demo # The folder the action should deploy.
27+
CLEAN: true # Automatically remove deleted files from the deploy branch

.github/workflows/publish.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build and Publish to NPM
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
jobs:
7+
build-and-release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v2
12+
13+
- name: Setup node 🔨
14+
uses: actions/setup-node@v2
15+
with:
16+
node-version: 12
17+
registry-url: https://registry.npmjs.org/
18+
19+
- name: Install and Build 🔧
20+
run: |
21+
npm install
22+
npm run build
23+
24+
- name: Publish to NPM 🚀
25+
run: cd dist/ngx-diff2html && npm publish
26+
env:
27+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)