Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/continuous deployment to gh pages #23

Merged
merged 2 commits into from May 20, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+19 −5
Diff settings

Always

Just for now

Copy path View file
@@ -11,23 +11,33 @@ jobs:
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && npm run test:travis || npm run test:travis:pr' # don't record with cypress (don't have access to API key on PRs)
before_deploy:
- tar czvf build.tar.gz -C build .
deploy: # Deploy to staging on each commit to master
- provider: surge
deploy:
- provider: surge # Deploy to staging on each commit to master
project: ./build/
domain: staging-npm-registry-browser.surge.sh
skip_cleanup: true
on:
branch: master
- provider: releases
- provider: releases # Upload build artefacts to github releases on each tag on master
api_key:
secure: i7v1KFG/fviiPx2g6QlFo4+56CdEbqj2FRgtRldVVMHAHlLizNxfFATeidWND3W9ydSKNddpCFN6CIr2CPhuzAbRnMPwsU3r7YxGJEINFubvlbxIvVu6XPSiGOiSEmZQ0kLhN7AS9f9gYP0Hklg70cEKdDGIxhsNCrXcGkS3aKADDvr3sTOkjnFcYZkIgCl/kTFKA+7HomfBxfmzu/bvbhEmKfDRmDzWSuKRVlYo1wVPCdmA//wvK8xzCBQd3payrcMTDcH0O8rNBarnQDJ1HlZKOmwyRAcYyAZHjIgqTQi+6czDRPVMJOZDoBEphYvVYTkJIZo8lhKfRmTi6OTuL3LJvh9Drd1IIuNaCtlMpjy+em+wrM/HsBnRniNdqWqc5jyTYPCSGSEVRUawMVHNTtnwLwhraDiubqDOsHatngGbAV6ESygamIIQB3A/EjvGSlCLARJdX4oiEIfexjDc5F0xXbHx8HoTZc62wNwP0H22T20NLG6+9prcLeLF3s3u/VDS6te39fEGu/vLPGPfJXjmhJUfLr51v/6xKmqscsjHDNI4j/rv+y+vNtbJjjPUOmmJ40YgzlcLRc2AqVOmW/qVR+pmhp/8QNKuj2w2B/uxdttDgQDAhllMLCQ7+byBRsdhFBltWq0XdH3upmTkQxTFYETGZ2aWleUaeJMUbXI=
file: "./build.tar.gz"
skip_cleanup: true
on:
tags: true
branch: master
- provider: pages # Deploy to gh-pages on each tag on master
skip_cleanup: true
github_token:
secure: i7v1KFG/fviiPx2g6QlFo4+56CdEbqj2FRgtRldVVMHAHlLizNxfFATeidWND3W9ydSKNddpCFN6CIr2CPhuzAbRnMPwsU3r7YxGJEINFubvlbxIvVu6XPSiGOiSEmZQ0kLhN7AS9f9gYP0Hklg70cEKdDGIxhsNCrXcGkS3aKADDvr3sTOkjnFcYZkIgCl/kTFKA+7HomfBxfmzu/bvbhEmKfDRmDzWSuKRVlYo1wVPCdmA//wvK8xzCBQd3payrcMTDcH0O8rNBarnQDJ1HlZKOmwyRAcYyAZHjIgqTQi+6czDRPVMJOZDoBEphYvVYTkJIZo8lhKfRmTi6OTuL3LJvh9Drd1IIuNaCtlMpjy+em+wrM/HsBnRniNdqWqc5jyTYPCSGSEVRUawMVHNTtnwLwhraDiubqDOsHatngGbAV6ESygamIIQB3A/EjvGSlCLARJdX4oiEIfexjDc5F0xXbHx8HoTZc62wNwP0H22T20NLG6+9prcLeLF3s3u/VDS6te39fEGu/vLPGPfJXjmhJUfLr51v/6xKmqscsjHDNI4j/rv+y+vNtbJjjPUOmmJ40YgzlcLRc2AqVOmW/qVR+pmhp/8QNKuj2w2B/uxdttDgQDAhllMLCQ7+byBRsdhFBltWq0XdH3upmTkQxTFYETGZ2aWleUaeJMUbXI=
keep_history: true
local_dir: build
on:
tags: true
branch: master
after_deploy:
- curl https://staging-npm-registry-browser.surge.sh
- curl https://topheman.github.io/npm-registry-browser/
- stage: Mocked version deployment
if: branch = master AND tag IS present # skip this stage if not a tag on branch master
install: npm install
Copy path View file
@@ -11,6 +11,7 @@ Bellow, you will find some notes I took along the way.
* [Miscellaneous](#miscellaneous)
* [Eslint and Prettier](#eslint-and-prettier)
* [Cypress with cross-origin](#cypress-with-cross-origin)
* [Continuous deployment with Travis](#continuous-deployment-with-travis)
* [Cypress record on CI with pull requests from a fork](#cypress-record-on-ci-with-pull-requests-from-a-fork)
* [Api fallback](#api-fallback)
* [CORS anywhere development proxy](#cors-anywhere-development-proxy)
@@ -137,6 +138,8 @@ You can't manually set this header, you'll have the following error: `Refused to

Since the CORS proxies used in production ask for this origin header and it's missing when ran in cypress, we don't run through the CORS proxy when running tests in cypress with a production build - see [src/services/apis/index.js](src/services/apis/index.js).

### Continuous deployment with Travis

### Cypress record on CI with pull requests from a fork

> A pull request sent from a fork of the upstream repository could be manipulated to expose environment variables.
Copy path View file
@@ -204,8 +204,9 @@ On each commit (or PR) pushed to `master`, if the tests are passing, a version o

On each tag pushed to `master`:

* a mocked version will be automatically deployed to this server: https://mock-npm-registry-browser.surge.sh/ ([read more about mocks](#mock-mode))
* the artefacts generated during build (the `build` folder) will be automatically uploaded to the related release, so that you could re-download it at any time (see [releases](https://github.com/topheman/npm-registry-browser/releases) section)
* a new version will be deployed to the production server: https://topheman.github.io/npm-registry-browser/
* a mocked version will be deployed to this server: https://mock-npm-registry-browser.surge.sh/ ([read more about mocks](#mock-mode))
* the artefacts generated during build (the `build` folder) will be uploaded to the related release, so that you could re-download them at any time (see [releases](https://github.com/topheman/npm-registry-browser/releases) section)

📔 Resources:

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.