From df81e9468c245ec3ab9f038308790ac57d7c774b Mon Sep 17 00:00:00 2001 From: Richard Patel Date: Tue, 4 Jun 2019 16:29:30 +0200 Subject: [PATCH 1/2] deployment.md: Add instructions for Travis CI --- docs/guide/deployment.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index f6e44b250c..93563a134c 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -320,6 +320,40 @@ Verify your project is successfully published by Surge by visiting `myawesomepro cd - ``` +### GitHub Pages through Travis CI + +Deploy to GitHub Pages automatically using Travis CI. + +1. Set correct `publicPath` in `vue.config.js` as explained above. + +2. Install the Travis CLI client: `gem install travis && travis --login` + +3. Generate a GitHub [access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) + with repo permissions. + +4. Create a `.travis.yml` file in the root of your project. + + ```yaml + language: node_js + node_js: + - "node" + + cache: npm + + script: npm run build + + deploy: + provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + local_dir: dist + on: + branch: master + ``` +5. Grant the Travis job access to your repository: `travis set GITHUB_TOKEN=xxx` + (`xxx` is the personal access token from step 3.) + +6. Push the `.travis.yml` file to your repository to trigger the first build. ### Docker (Nginx) From 3e404eda31550a50f50a115f5d29cd0063489a31 Mon Sep 17 00:00:00 2001 From: Richard Patel Date: Fri, 5 Jul 2019 11:03:34 +0200 Subject: [PATCH 2/2] deployment.md: Same section for GitHub Pages --- docs/guide/deployment.md | 73 +++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/docs/guide/deployment.md b/docs/guide/deployment.md index 93563a134c..e1b12643d4 100644 --- a/docs/guide/deployment.md +++ b/docs/guide/deployment.md @@ -35,6 +35,8 @@ If you are using the PWA plugin, your app must be served over HTTPS so that [Ser ### GitHub Pages +#### Pushing updates manually + 1. Set correct `publicPath` in `vue.config.js`. If you are deploying to `https://.github.io/`, you can omit `publicPath` as it defaults to `"/"`. @@ -79,9 +81,39 @@ If you are using the PWA plugin, your app must be served over HTTPS so that [Ser cd - ``` - ::: tip - You can also run the above script in your CI setup to enable automatic deployment on each push. - ::: +#### Using Travis CI for automatic updates + +1. Set correct `publicPath` in `vue.config.js` as explained above. + +2. Install the Travis CLI client: `gem install travis && travis --login` + +3. Generate a GitHub [access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) + with repo permissions. + +4. Grant the Travis job access to your repository: `travis set GITHUB_TOKEN=xxx` + (`xxx` is the personal access token from step 3.) + +5. Create a `.travis.yml` file in the root of your project. + + ```yaml + language: node_js + node_js: + - "node" + + cache: npm + + script: npm run build + + deploy: + provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + local_dir: dist + on: + branch: master + ``` + +6. Push the `.travis.yml` file to your repository to trigger the first build. ### GitLab Pages @@ -320,41 +352,6 @@ Verify your project is successfully published by Surge by visiting `myawesomepro cd - ``` -### GitHub Pages through Travis CI - -Deploy to GitHub Pages automatically using Travis CI. - -1. Set correct `publicPath` in `vue.config.js` as explained above. - -2. Install the Travis CLI client: `gem install travis && travis --login` - -3. Generate a GitHub [access token](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) - with repo permissions. - -4. Create a `.travis.yml` file in the root of your project. - - ```yaml - language: node_js - node_js: - - "node" - - cache: npm - - script: npm run build - - deploy: - provider: pages - skip_cleanup: true - github_token: $GITHUB_TOKEN - local_dir: dist - on: - branch: master - ``` -5. Grant the Travis job access to your repository: `travis set GITHUB_TOKEN=xxx` - (`xxx` is the personal access token from step 3.) - -6. Push the `.travis.yml` file to your repository to trigger the first build. - ### Docker (Nginx) Deploy your application using nginx inside of a docker container.