Created
July 22, 2019 18:52
-
-
Save pjbrown11/725794684d484e94a792092f9c34ce30 to your computer and use it in GitHub Desktop.
Example of Cypress running end to end tests through Gitlab CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:latest | |
stages: | |
- test | |
- export | |
- deploy | |
cache: | |
paths: | |
- node_modules | |
- functions/node_modules | |
end_to_end_tests: | |
image: cypress/base:10 | |
stage: test | |
environment: Production | |
only: | |
- master | |
script: | |
- npm ci | |
- npm install -g firebase-tools | |
- firebase use test --token $FIREBASE_KEY | |
- npm test | |
artifacts: | |
expire_in: 1 week | |
when: always | |
paths: | |
- cypress/screenshots | |
- cypress/videos | |
build_static_site: | |
stage: export | |
environment: Production | |
only: | |
- master | |
script: | |
- npm ci | |
- npm run export | |
artifacts: | |
paths: | |
- __sapper__/export | |
firebase_deploy: | |
stage: deploy | |
environment: Production | |
only: | |
- master | |
script: | |
- cd functions && npm install && cd ../ | |
- npm install -g firebase-tools | |
- firebase use production --token $FIREBASE_KEY | |
- firebase deploy -m "Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive --token $FIREBASE_KEY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment