Skip to content

Commit fd837b3

Browse files
authored
Create ci-cd.yml
1 parent 0272348 commit fd837b3

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/ci-cd.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI/CD for PDF Service
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: '14'
21+
cache: 'npm'
22+
cache-dependency-path: package-lock.json
23+
24+
- name: Install dependencies
25+
run: npm install
26+
27+
- name: Configure AWS credentials
28+
uses: aws-actions/configure-aws-credentials@v1
29+
with:
30+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
31+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
32+
aws-region: us-east-2
33+
34+
- name: Package service
35+
run: npx serverless package
36+
37+
- name: Deploy service
38+
run: npx serverless deploy

0 commit comments

Comments
 (0)