-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Deploy Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint Code & Run Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Run ESLint | ||
run: npm run lint | ||
|
||
- name: Run Prettier | ||
run: npm run format | ||
|
||
- name: Run Tests | ||
run: npm run test | ||
|
||
deploy: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
needs: lint | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Deploy | ||
run: | | ||
serverless deploy \ | ||
--param="MONGODB_URI=${{ secrets.MONGODB_URI_PROD }}" \ | ||
--param="EVENT_BUS_NAME=${{ secrets.EVENT_BUS_PROD }}" \ | ||
--param="EVENT_SOURCE=${{ secrets.EVENT_SOURCE }}" \ | ||
--param="AWS_ACCOUNT_ID=${{ secrets.AWS_ACCOUNT_ID }}" \ | ||
--param="AWS_REGION=${{ secrets.AWS_REGION }}" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,17 +7,20 @@ provider: | |
runtime: nodejs20.x | ||
region: eu-north-1 | ||
environment: | ||
MONGODB_URI: "mongodb+srv://root:[email protected]/?retryWrites=true&w=majority&appName=orbital-test-0" | ||
# MONGODB_URI: ${ssm:/accounts-service/MONGODB_URI} | ||
# EVENT_BUS_NAME: ${ssm:/my-service/EVENT_BUS_NAME~true} | ||
MONGODB_URI: ${param:MONGODB_URI} | ||
EVENT_BUS_NAME: ${param:EVENT_BUS_NAME} | ||
EVENT_SOURCE: ${param:EVENT_SOURCE} | ||
AWS_ACCOUNT_ID: ${param:AWS_ACCOUNT_ID} | ||
AWS_REGION: ${param:AWS_REGION} | ||
|
||
iam: | ||
role: | ||
statements: | ||
- Effect: Allow | ||
Action: | ||
- events:PutEvents | ||
Resource: | ||
- arn:aws:events:eu-north-1:586064767793:event-bus/default | ||
- arn:aws:events:${param:AWS_REGION}:${param:AWS_ACCOUNT_ID}:event-bus/${param:EVENT_BUS_NAME} | ||
|
||
functions: | ||
createAccount: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters