mirror of
https://github.com/zhigang1992/now-deployment.git
synced 2026-04-29 04:25:28 +08:00
docs: example
angular
This commit is contained in:
22
.github/workflows/example-angular.yml
vendored
Normal file
22
.github/workflows/example-angular.yml
vendored
Normal 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'
|
||||
@@ -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'
|
||||
31
example/angular/src/now.json
Normal file
31
example/angular/src/now.json
Normal 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" }
|
||||
]
|
||||
}
|
||||
@@ -7,9 +7,6 @@
|
||||
"enabled": false
|
||||
},
|
||||
"builds": [
|
||||
{ "src": "./public/**", "use": "@now/static" }
|
||||
],
|
||||
"routes": [
|
||||
{ "src": "/(.*)", "dest": "public/$1" }
|
||||
{ "src": "./**", "use": "@now/static" }
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user