-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (50 loc) · 2.08 KB
/
build.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
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14'
- name: Install dependencies
run: yarn
- name: Run tests
run: yarn test
- name: Create bundle
run: yarn dist
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Zip bundle
run: zip -r dist.zip ./* && zip -uj dist.zip ./infra/Makefile ./infra/serverless.yml
- name: Upload artifacts to the common S3 bucket for build artitacts of all apps
uses: medlypharmacy/s3-artifacts-action@master
with:
aws_access_key_id: ${{ secrets.S3_BUILD_ARTIFACTS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.S3_BUILD_ARTIFACTS_SECRET_ACCESS_KEY }}
aws_region: us-east-1
source_path: './dist.zip'
aws_s3_bucket_name: ${{ secrets.S3_BUILD_ARTIFACTS_BUCKET_NAME }}
- name: Deploy to Dev Environment
uses: medlypharmacy/codepipeline-webhook-action@master
if: github.ref == 'refs/heads/master'
with:
deployment_environment: 'dev'
codepipeline_webhook_url: ${{ secrets.CODEPIPELINE_WEBHOOK_URL }}
codepipeline_webhook_secret: ${{ secrets.CODEPIPELINE_WEBHOOK_SECRET }}