-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
52 lines (47 loc) · 1.59 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
language: python
python: # For Django
- 3.6
node_js: # For building Vue bundle
- "node"
branches:
# Only run on these branches
# Note: can still automatically run on pull requests, etc. according to setting in web interface
only:
- master
install:
# Install Django dependencies using Pipenv
- pip install pipenv
- pipenv install
# Install Vue dependencies using NPM
- cd arkav-is-web
- npm install
- cd ..
script:
# Test Django
- pipenv run python manage.py test
# Test Vue
- cd arkav-is-web
- npm run test
- cd ..
before_deploy:
# Copy Django static files to static directory
- pipenv run python manage.py collectstatic
# Build Vue bundle, which will be placed in the arkav-is-web/dist directory
- cd arkav-is-web
- npm run build
- cd ..
# Clean up non-repository files except build results and static files
# by stashing all files, then checking out only arkav-is-web/dist and static directories
# ^3 refers to the untracked files in the stash:
# https://stackoverflow.com/questions/12681529/in-git-is-there-a-way-to-show-untracked-stashed-files-without-applying-the-stas
- git stash --all
- git checkout stash@{0}^3 ./arkav-is-web/dist ./static
deploy:
# Push all project files, including build results, to the deploy branch
provider: pages
skip-cleanup: true # Include files not in repository (build results, etc.) in deployment push
target_branch: deploy
github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep-history: true
on:
branch: master # Only deploy if running on the master branch