-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildspec.yml
39 lines (36 loc) · 1.21 KB
/
buildspec.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
# Documentation https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html
# Adapted from https://github.com/backspace-academy/aws-nodejs-sample-codebuild/blob/master/buildspec.yml
version: 0.2
env:
variables:
NODE_ENV: "production"
# Basically runs the commands from top to bottom during CodeBuild
phases:
install:
runtime-versions:
nodejs: 10
commands:
- echo Installing yarn...
- npm install -g yarn
pre_build:
commands:
- echo Installing npm dependencies
- npm install
build:
commands:
- echo Building the web app, started on `date`
- yarn build
post_build:
commands:
- echo Build completed on `date`
# Here I specify what the CodeBuild output artifact should contain.
# Artifacts should only contain the files needed for the app to run. In this case, these files are
# simply everything produced by the 'yarn build' command, i.e. everything under the 'build' directory.
# Do not replace with
# files: - 'build/**/*'
# as this will include the build folder as well when deploying to S3, which won't work because index.html
# won't be at the root of the bucket.
artifacts:
files:
- '**/*'
base-directory: build