Skip to content

Build

Build #3498

Workflow file for this run

name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
# - cron: "50 13 * * 1-5" # free edition mon-fri 8:50 ET
- cron: "50 12 * * 1-5" # free edition mon-fri 8:50 ET DST
# - cron: "55 13 * * 1-5" # premium morning mon-fri 8:55 ET
- cron: "55 12 * * 1-5" # premium morning mon-fri 8:55 ET DST
- cron: "01 21 * * 1-5" # premium afternoon mon-fri 4:01 ET
- cron: "00 09 * * 1-5" # build archive mon-fri 6:00 ET
env:
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_REGION: us-west-2
MARKET_API: ${{secrets.MARKET_API}}
TOP_GAINERS_LOSERS_API: ${{secrets.TOP_GAINERS_LOSERS_API}}
MAILERLITE_API_KEY: ${{secrets.MAILERLITE_API_KEY}}
FREE_GROUP: ${{secrets.FREE_GROUP}}
PREMIUM_GROUP: ${{secrets.PREMIUM_GROUP}}
PREMIUM_GROUP_TRIAL: ${{secrets.PREMIUM_GROUP_TRIAL}}
# TEST_GROUP: ${{secrets.TEST_GROUP}}
# TEST_GROUP_TRIAL: ${{secrets.TEST_GROUP_TRIAL}}
SENTRY_DSN: ${{secrets.SENTRY_DSN}}
IEX_TOKEN: ${{secrets.IEX_TOKEN}}
STOCK_NEWS: ${{secrets.STOCK_NEWS}}
DB_API: ${{secrets.DB_API}}
jobs:
build:
if: github.event_name == 'push' || github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- run: |
npm install -g mjml
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
mkdir tmp
bundle config path vendor/bundle
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run tests
env:
TEST_GROUP: ${{secrets.TEST_GROUP}}
TEST_GROUP_TRIAL: ${{secrets.TEST_GROUP_TRIAL}}
run: bundle exec rake
free:
if: contains(github.event.schedule, '50 12 * * 1-5')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- run: |
npm install -g mjml
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
mkdir tmp
bundle config path vendor/bundle
gem install bundler
bundle install --jobs 4 --retry 3
- name: Trigger free edition email
run: bundle exec rake send_free_edition
morning:
if: contains(github.event.schedule, '55 12 * * 1-5')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- run: |
npm install -g mjml
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
mkdir tmp
bundle config path vendor/bundle
gem install bundler
bundle install --jobs 4 --retry 3
- name: Trigger morning edition email
run: bundle exec rake send_morning_edition
afternoon:
if: contains(github.event.schedule, '01 21 * * 1-5')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- run: |
npm install -g mjml
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
mkdir tmp
bundle config path vendor/bundle
gem install bundler
bundle install --jobs 4 --retry 3
- name: Trigger afternoon edition email
run: bundle exec rake send_afternoon_edition
archive:
if: contains(github.event.schedule, '00 09 * * 1-5')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12"
- run: |
npm install -g mjml
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.7
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Install gems
run: |
mkdir tmp
bundle config path vendor/bundle
gem install bundler
bundle install --jobs 4 --retry 3
- name: Build archive
run: bundle exec rake build_archive