-
Notifications
You must be signed in to change notification settings - Fork 70
51 lines (48 loc) · 1.65 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
name: Build
env:
CI: false
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- develop
- main
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
serverless:
# Name the Job
name: Upload Extensions
# Set the type of machine to run on
runs-on: ubuntu-20.04
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v3.x
- name: Checkout code
uses: actions/checkout@v2
- name: Use Node.js 16
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Install node modules
run: yarn install
- name: Build ${{ env.GITHUB_REF_SLUG }}
run: yarn build:${{ env.GITHUB_REF_SLUG }}
- name: Publish ${{ env.GITHUB_REF_SLUG }}
run: yarn serverless:deploy:${{ env.GITHUB_REF_SLUG }}
- name: Build extensions ${{ env.GITHUB_REF_SLUG }} stack
run: yarn build:extension
- name: Upload bundle into S3
run: yarn upload:bundle:${{ env.GITHUB_REF_SLUG }}
env: # Or as an environment variable
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
GITHUB_SHA: ${{ env.GITHUB_SHA }}
GITHUB_RUN_ID: ${{ env.GITHUB_RUN_ID }}