Skip to content

Commit 33f87cb

Browse files
committed
Add deploy job
1 parent 6861616 commit 33f87cb

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ on:
44
push:
55
branches:
66
- main
7-
pull_request:
7+
8+
env:
9+
AWS_REGION: us-east-1
810

911
jobs:
1012
build:
@@ -19,7 +21,7 @@ jobs:
1921
node-version: '20'
2022
cache: 'yarn'
2123
- name: Install dependencies
22-
run: yarn --prefer-offline
24+
run: yarn --prefer-offline --frozen-lockfile
2325
- name: Check the types
2426
run: yarn type-check
2527
- name: Lint
@@ -28,4 +30,30 @@ jobs:
2830
run: yarn build
2931
- name: Test
3032
run: yarn test
31-
# call steps to run a deploy at dev|staging environment
33+
34+
deploy:
35+
name: Deploy
36+
needs: build
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
- name: Setup Node.js
42+
uses: actions/setup-node@v3
43+
with:
44+
node-version: '20'
45+
cache: 'yarn'
46+
- name: Install dependencies
47+
run: yarn --prefer-offline --frozen-lockfile
48+
- name: Build
49+
run: yarn build
50+
- name: Configure AWS credentials
51+
uses: aws-actions/configure-aws-credentials@v4
52+
with:
53+
aws-region: ${{ env.AWS_REGION }}
54+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
55+
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
56+
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_ARN }}
57+
mask-aws-account-id: true
58+
- name: Use AWS CLI
59+
run: aws s3 ls

0 commit comments

Comments
 (0)