docs: example

angular
This commit is contained in:
Minsu Lee
2019-12-03 01:15:54 +09:00
parent 6f22b8659b
commit 7b7eb27a95
4 changed files with 56 additions and 10 deletions

22
.github/workflows/example-angular.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: example - static
on:
push:
# branches:
# - master
jobs:
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: build
run: |
cd example/angular
npm install
npx ng build --prod
- uses: amondnet/now-deployment@v1
id: now-deployment
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
zeit-token: ${{ secrets.ZEIT_TOKEN }}
now-args: '--prod example/angular/dist/angular'

View File

@@ -5,17 +5,13 @@ on:
# - master
jobs:
deploy:
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: static
run: |
echo 'static example'
cd example/static
- uses: amondnet/now-deployment@v1
id: now-deployment
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
zeit-token: ${{ secrets.ZEIT_TOKEN }}
now-args: '--prod'
now-args: '--prod example/static'

View File

@@ -0,0 +1,31 @@
{
"name": "zeit-now-deployment-action-example-angular",
"version": 2,
"scope": "amond",
"public": false,
"github": {
"enabled": false
},
"builds": [
{ "src": "./**", "use": "@now/static" }
],
"routes": [
{
"src": "/(assets/.+|amcharts/.+|.+\\.css|.+\\.js|.+\\.eot|.+\\.svg|.+\\.ttf|.+\\.woff|.+\\.gif|.+\\.png|.+\\.jpg)",
"headers": { "cache-control": "max-age=31536000,immutable" },
"dest": "/$1"
},
{
"src": "/(.*).html",
"headers": { "cache-control": "public,max-age=0,must-revalidate" },
"dest": "/$1.html"
},
{
"src": "/(.*)",
"headers": { "cache-control": "public,max-age=0,must-revalidate" },
"dest": "/index.html"
},
{ "src": "/robots.txt", "dest": "/robots.txt" },
{ "src": "/favicon.ico", "dest": "/favicon.txt" }
]
}

View File

@@ -7,9 +7,6 @@
"enabled": false
},
"builds": [
{ "src": "./public/**", "use": "@now/static" }
],
"routes": [
{ "src": "/(.*)", "dest": "public/$1" }
{ "src": "./**", "use": "@now/static" }
]
}