-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (58 loc) · 2.09 KB
/
master.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: MyCryptoBuilds Master
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1'
on:
push:
branches:
- master
jobs:
Master:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v1
# Define url as env var to be used by TestCafe.
- name: Set E2E_BASE_URL
run: |
E2E_BASE_URL=$( echo https://landing.mycryptobuilds.com )
echo $E2E_BASE_URL
echo "E2E_BASE_URL=$E2E_BASE_URL" >> $GITHUB_ENV
- name: Retrieve engines' versions from package.json to env variables
id: engines
run: echo "##[set-output name=NVMRC;]$(cat package.json | grep '\"node\":' | sed 's/^ *//;s/ *$//;s/\"node\":\ \"//;s/\",//' )"
- name: Setup node ${{ steps.engines.outputs.NODE_VERSION }}
uses: actions/setup-node@main
with:
node-version: ${{ steps.engines.outputs.NODE_VERSION }}
- name: Cache depedendencies
id: cache
uses: actions/cache@v1
with:
path: node_modules
## Check cache based on yarn.lock hashfile
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ env.cache-name }}-
${{ runner.os }}-yarn-
${{ runner.os }}-
- name: Install dependencies
## If no cache is found, install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn
- name: yarn build master
run: yarn build:staging
env:
PATH_PREFIX: '/master'
- name: S3 Sync - Master
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --acl public-read --cache-control max-age=0 --follow-symlinks --delete --exclude '.git/*'
env:
DEST_DIR: 'master'
SOURCE_DIR: 'public'
# Launch E2E tests. When in pull request it runs against the PR's mycryptobuilds url.
- name: E2E - run
run: yarn test:e2e