forked from neu-se/covey.town
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (38 loc) · 1.7 KB
/
main.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
name: Covey.Town CI
on: # Controls when the action will run.
# Triggers the workflow on push or pull request events but only for the master branch. If you want to trigger the action on other branches, add here
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-and-test: #
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Build and test backend service
env: # Pass the Twilio secrets into environmental variables for the backend tests to use
TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }}
TWILIO_API_AUTH_TOKEN: ${{ secrets.TWILIO_API_AUTH_TOKEN }}
TWILIO_API_KEY_SECRET: ${{ secrets.TWILIO_API_KEY_SECRET }}
TWILIO_API_KEY_SID: ${{ secrets.TWILIO_API_KEY_SID }}
MONGO_URL: ${{ secrets.MONGO_URL }}
run: cd services/roomService; npm install && npm run lint && npm test
- name: Build and test frontend components
run: cd frontend; npm install && npm run lint && npm test
deploy:
if: github.ref == 'refs/heads/master'
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: akhileshns/[email protected] # Deploy to Heroku action
with:
heroku_api_key: ${{secrets.HEROKU_API_KEY}}
heroku_app_name: ${{secrets.HEROKU_APP_NAME}}
heroku_email: ${{secrets.HEROKU_EMAIL}}