Skip to content

Commit 61978a8

Browse files
committed
Added CD framework
1 parent dbf6271 commit 61978a8

File tree

3 files changed

+53
-2
lines changed

3 files changed

+53
-2
lines changed

.github/workflow/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Serverless S3
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: [17.x]
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- run: npm install
22+
- run: npm run build
23+
- run: aws s3 rm s3://neodash-test.graphapp.io/ --recursive && aws s3 sync dist s3://neodash-test.graphapp.io/ --acl public-read
24+
env:
25+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
26+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

scripts/upload-to-s3.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
npm run build
2-
aws s3 rm s3://neodash.graphapp.io/ --recursive
3-
aws s3 sync dist s3://neodash.graphapp.io/ --acl public-read
2+
aws s3 rm s3://neodash-test.graphapp.io/ --recursive
3+
aws s3 sync dist s3://neodash-test.graphapp.io/ --acl public-read

serverless.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Welcome to serverless. Read the docs
2+
# https://serverless.com/framework/docs/
3+
4+
# Serverless.yml is the configuration the CLI
5+
# uses to deploy your code to your provider of choice
6+
7+
# The `service` block is the name of the service
8+
service: neodash
9+
10+
frameworkVersion: '3'
11+
12+
# The `provider` block defines where your service will be deployed
13+
provider:
14+
name: aws
15+
runtime: nodejs12.x
16+
17+
plugins:
18+
- serverless-finch
19+
20+
custom:
21+
client:
22+
bucketName: neodash-test.graphapp.io
23+
distributionFolder: build
24+
indexDocument: index.html
25+
errorDocument: index.html

0 commit comments

Comments
 (0)