-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (28 loc) · 1.3 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
language: node_js # Node.js based project
node_js:
- 14.15.0 # Level of Node.js to use
env:
- NEXT_TELEMETRY_DISABLED=1 # disable Next JS telemetry
- NEXT_PUBLIC_GOOGLE_ANALYTICS_V4_MEASUREMENT_ID=$google_analytics_v4_measurement_id
- GOOGLE_REPORTING_V4_API_KEY=$google_reporting_v4_api_key
before_install:
- export NEXT_PUBLIC_GOOGLE_ANALYTICS_V4_MEASUREMENT_ID
- export GOOGLE_REPORTING_V4_API_KEY
cache:
directories:
- node_modules # Cache the node_modules folder for quicker build times
script:
- npm run build # Runs next build
- npm run export # Runs next export and generates the out directory
- touch out/.nojekyll # Creates a file telling Github not to build the project using Jekyll
deploy:
provider: pages # Informs Travis this is a deployment to GitHub Pages
skip_cleanup: true # Prevents Travis from resetting the working directory made during the build
github_token: $github_token # GitHub access token to use when pushing to the gh-pages branch
local_dir: out # Directory to push to the gh-pages branch
fqdn: $fqdn # CNAME record to point custom domain
on:
# Only deploy when the build is on master or main branch - two common default branch names
# If you're using a different branch name, add it here
all_branches: true
condition: $TRAVIS_BRANCH =~ ^(master|main)$