Skip to content

Commit f111c89

Browse files
committed
feat(workspace): add deploy demo to GH pages
1 parent 98ef715 commit f111c89

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.travis-deploy.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
echo Deploy to GitHub Pages
4+
5+
# only deploy tags
6+
if [ -z "$TRAVIS_TAG" ]; then
7+
8+
echo Deploy to GitHub Pages - Skip deployment
9+
10+
else
11+
12+
echo Deploy to GitHub Pages - Start
13+
14+
# go to the directory which contains build artifacts and create a *new* Git repo
15+
# directory may be different based on your particular build process
16+
cd dist/elements-demo
17+
git init
18+
19+
# inside this git repo we'll pretend to be a new user
20+
git config user.name "Travis CI"
21+
git config user.email "tomas.trajan@gmail.com"
22+
23+
# The first and only commit to this new Git repo contains all the
24+
# files present with the commit message "Deploy to GitHub Pages".
25+
git add .
26+
git commit -m "Deploy to GitHub Pages"
27+
28+
# Force push from the current repo's master branch to the remote
29+
# repo's gh-pages branch. (All previous history on the gh-pages branch
30+
# will be lost, since we are overwriting it.) We redirect any output to
31+
# /dev/null to hide any sensitive credential data that might otherwise be exposed.
32+
# tokens GH_TOKEN and GH_REF will be provided as Travis CI environment variables
33+
git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
34+
35+
echo Deploy to GitHub Pages - Success
36+
37+
fi
38+
39+
echo Deploy to GitHub Pages - Finish

angular.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
"build": {
4949
"builder": "@angular-devkit/build-angular:browser",
5050
"options": {
51+
"deployUrl": "elements-demo",
52+
"baseHref": "elements-demo",
5153
"outputPath": "dist/elements-demo",
5254
"index": "projects/elements-demo/src/index.html",
5355
"main": "projects/elements-demo/src/main.ts",

0 commit comments

Comments
 (0)