Skip to content

Commit

Permalink
feat: setup gh-pages with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lerke committed Sep 27, 2024
1 parent 79aced6 commit 4ce6ee8
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 21 deletions.
44 changes: 34 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,36 @@ name: CI Master
on:
push:
branches:
- master
- 'dev-2.0.0'
# tags:
# - '*'

jobs:
build-library:
# build-library:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v1
# - name: Setup node
# uses: actions/setup-node@v1
# with:
# node-version: "14"
# registry-url: https://registry.npmjs.org
# - name: Install dependencies
# run: |
# npm ci
# npm uninstall -g @angular/cli
# npm install -g @angular/cli@12
# - name: Set Version
# run: sed -i "s/\[ci-version\]/${GITHUB_REF##*/}-$GITHUB_RUN_NUMBER/g" ./version.ts
# - name: Build Library
# run: ng build --project angular-toastify
# - name: Publish Library to NPM
# run: npm publish ./dist/angular-toastify
# env:
# NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}

deploy-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -18,14 +44,12 @@ jobs:
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: |
npm ci
npm ci --force
npm uninstall -g @angular/cli
npm install -g @angular/cli@12
- name: Set Version
run: sed -i "s/\[ci-version\]/${GITHUB_REF##*/}-$GITHUB_RUN_NUMBER/g" ./version.ts
- name: Build Library
run: ng build --project angular-toastify
- name: Publish Library to NPM
run: npm publish ./dist/angular-toastify
- name: Deploy pages
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ng build --base-href "/angular-toastify/"
npx angular-cli-ghpages --dir=dist/demo
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"angular-cli-ghpages": "^1.0.0-rc.2",
"angular-cli-ghpages": "^1.0.7",
"codelyzer": "^5.0.0",
"injection-js": "^2.4.0",
"jasmine-core": "~3.4.0",
Expand Down

0 comments on commit 4ce6ee8

Please sign in to comment.