Skip to content

Commit

Permalink
fix: support replace deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
yugasun authored and Yuga Sun committed Oct 20, 2020
1 parent 420da8f commit 31b29c7
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 288 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ jobs:
- name: Running integration tests
run: npm run test
env:
SERVERLESS_PLATFORM_VENDOR: tencent
GLOBAL_ACCELERATOR_NA: true
TENCENT_SECRET_ID: ${{ secrets.TENCENT_SECRET_ID }}
TENCENT_SECRET_KEY: ${{ secrets.TENCENT_SECRET_KEY }}
266 changes: 0 additions & 266 deletions example/README.md

This file was deleted.

26 changes: 15 additions & 11 deletions example/nuxt.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
export default {
mode: 'universal',
env: {
STATIC_URL: process.env.STATIC_URL || ''
},
/*
** Build configuration
*/
build: {
extend(config, { isDev, isClient }) {
if (!isDev && process.env.STATIC_URL) {
config.output.publicPath = process.env.STATIC_URL
}
}
},
/*
** Headers of the page
*/
Expand All @@ -14,7 +27,7 @@ export default {
content: 'Serverless Nuxt.js Application Created By Serverless Framework'
}
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
link: [{ rel: 'icon', type: 'image/x-icon', href: `${process.env.STATIC_URL}/favicon.ico` }]
},
/*
** Customize the progress-bar color
Expand All @@ -35,14 +48,5 @@ export default {
/*
** Nuxt.js modules
*/
modules: [],
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, ctx) {}
}
modules: []
}
13 changes: 7 additions & 6 deletions example/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<div class="container">
<div>
<logo />
<h1 class="title">nuxt-demo</h1>
<h2 class="subtitle">Serverless Nuxt.js Application Created By Serverless Framework</h2>
<div class="links">
<a href="https://nuxtjs.org/" target="_blank" class="button--green">Documentation</a>
<a href="https://github.com/nuxt/nuxt.js" target="_blank" class="button--grey">GitHub</a>
</div>
<h1 class="title">Welcome to Nuxt.js</h1>
<h2 class="subtitle">
The SSR app is hosted on
<a href="https://cloud.tencent.com/product/ssr" target="_blank" rel="noopener noreferrer">
Serverless SSR
</a>
</h2>
</div>
</div>
</template>
Expand Down
9 changes: 9 additions & 0 deletions example/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,12 @@ inputs:
- http
- https
environment: release
staticConf:
cosConf:
replace: true
bucket: nuxtjs-demo
sources:
- src: .nuxt/dist/client
targetDir: /
- src: static
targetDir: /
24 changes: 23 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"publishConfig": {
"access": "public"
},
"description": "Tencent Cloud Nuxt.js Serverless Component",
"scripts": {
"test": "jest ./tests/integration.test.js --testEnvironment node",
"commitlint": "commitlint -f HEAD@{15}",
Expand Down Expand Up @@ -57,5 +58,26 @@
"lint-staged": "^10.0.8",
"prettier": "^1.19.1",
"semantic-release": "^17.0.4"
}
},
"directories": {
"doc": "docs",
"example": "example",
"test": "tests"
},
"repository": {
"type": "git",
"url": "git+https://github.com/serverless-components/tencent-nuxtjs.git"
},
"keywords": [
"serverless-nuxtjs",
"nuxtjs",
"serverless",
"serverless-framework",
"serverless-components",
"tencent-cloud"
],
"bugs": {
"url": "https://github.com/serverless-components/tencent-nuxtjs/issues"
},
"homepage": "https://github.com/serverless-components/tencent-nuxtjs#readme"
}
2 changes: 1 addition & 1 deletion serverless.component.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: nuxtjs
version: 0.1.5
version: 0.1.6
author: 'Tencent Cloud, Inc.'
org: 'Tencent Cloud, Inc.'
description: Deploy a serverless Nuxt.js application onto Tencent SCF and API Gateway.
Expand Down
Loading

0 comments on commit 31b29c7

Please sign in to comment.