This repository was archived by the owner on Dec 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (65 loc) · 2.66 KB
/
Copy pathdevelop.yml
File metadata and controls
68 lines (65 loc) · 2.66 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Set staging configuration
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}
PORT: ${{ secrets.API_PORT}}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
LOG_LEVEL: ${{ secrets.LOG_LEVEL }}
MAILGUN_API_KEY: ${{ secrets.MAILGUN_API_KEY }}
MAILGUN_DOMAIN: ${{ secrets.MAILGUN_DOMAIN }}
API_URL: ${{ secrets.API_URL }}
FRONTEND_URL: ${{ secrets.FRONTEND_URL }}
MONGO_INITDB_ROOT_USERNAME: ${{ secrets.MONGO_INITDB_ROOT_USERNAME }}
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install backend
run: npm install --prefix ./api
- name: Test backend
run: npm test --prefix ./api
- name: Build backend container
run: docker build --build-arg JWT_SECRET --build-arg MONGODB_URI --build-arg PORT --build-arg DB_PASSWORD --build-arg DB_USERNAME --build-arg LOG_LEVEL --build-arg MAILGUN_API_KEY --build-arg MAILGUN_DOMAIN --build-arg API_URL --build-arg FRONTEND_URL api/ -t akela_api:latest
# - name: Build containers
# run: make build
- name: Login to Heroku Container registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: heroku container:login
- name: Push and release api Heroku Container registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: make heroku.push.api
- name: Install frontend
run: npm install --prefix ./web
- name: Build frontend
run: npm run build --prefix ./web
- name: Test frontend
uses: cypress-io/github-action@v1
with:
start: npm start
config-file: cypress.json
working-directory: web
- name: Build frontend container
run: docker build web/ -t akela_web:latest
- name: Push and release web Heroku Container registry
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
run: make heroku.push.web