Skip to content

Commit b9f1e88

Browse files
authored
Merge pull request #24 from ajaysinghj8/setup-gh-pages
ci: deploy example to GitHub Pages on every push to master
2 parents 7db5838 + ddf79a7 commit b9f1e88

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Deploy Example to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [master]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
deploy:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
cache: 'npm'
24+
25+
# Library devDeps must be installed so the example build can resolve
26+
# @angular/core from the root node_modules (path alias ../src/public-api.ts)
27+
- name: Install library dependencies
28+
run: npm ci
29+
30+
- name: Install example dependencies
31+
run: npm ci
32+
working-directory: example
33+
34+
- name: Build example
35+
run: npx ng build --base-href /angular-draggable/ --configuration production
36+
working-directory: example
37+
38+
- name: Add .nojekyll
39+
run: touch example/dist/example/browser/.nojekyll
40+
41+
- name: Deploy to gh-pages branch
42+
uses: peaceiris/actions-gh-pages@v4
43+
with:
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
publish_dir: example/dist/example/browser
46+
force_orphan: true
47+
commit_message: 'deploy: ${{ github.sha }}'

0 commit comments

Comments
 (0)