Skip to content

Commit

Permalink
Add GH workflow actions to deploy all services
Browse files Browse the repository at this point in the history
  • Loading branch information
hammady committed Jul 6, 2024
1 parent eea3822 commit 7660f8a
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 6 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/sls-forwarder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# github action to deploy forwarder sls service to prod

name: Deploy forwarder service to prod

on:
push:
branches:
- main
paths:
- forwarder/**
- .github/workflows/sls-forwarder.yaml

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install serverless framework
run: npm install -g serverless
- name: Install node dependencies
working-directory: forwarder
run: npm ci
- name: Install python3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Package and deploy
working-directory: forwarder
run: |
serverless deploy \
--region ${{ vars.AWS_REGION }} \
--stage ${{ vars.SLSSTAGE }} \
--verbose
45 changes: 45 additions & 0 deletions .github/workflows/sls-generator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# github action to deploy generator sls service to prod

name: Deploy generator service to prod

on:
push:
branches:
- main
paths:
- generator/**
- .github/workflows/sls-generator.yaml

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install serverless framework
run: npm install -g serverless
- name: Install node dependencies
working-directory: generator
run: npm ci
- name: Install python3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Package and deploy
working-directory: generator
run: |
serverless deploy \
--region ${{ vars.AWS_REGION }} \
--stage ${{ vars.SLSSTAGE }} \
--verbose
45 changes: 45 additions & 0 deletions .github/workflows/sls-notifier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# github action to deploy notifier sls service to prod

name: Deploy notifier service to prod

on:
push:
branches:
- main
paths:
- notifier/**
- .github/workflows/sls-notifier.yaml

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install serverless framework
run: npm install -g serverless
- name: Install node dependencies
working-directory: notifier
run: npm ci
- name: Install python3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Package and deploy
working-directory: notifier
run: |
serverless deploy \
--region ${{ vars.AWS_REGION }} \
--stage ${{ vars.SLSSTAGE }} \
--verbose
45 changes: 45 additions & 0 deletions .github/workflows/sls-scraper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# github action to deploy scraper sls service to prod

name: Deploy scraper service to prod

on:
push:
branches:
- main
paths:
- scraper/**
- .github/workflows/sls-scraper.yaml

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ vars.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install serverless framework
run: npm install -g serverless
- name: Install node dependencies
working-directory: scraper
run: npm ci
- name: Install python3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Package and deploy
working-directory: scraper
run: |
serverless deploy \
--region ${{ vars.AWS_REGION }} \
--stage ${{ vars.SLSSTAGE }} \
--verbose
7 changes: 1 addition & 6 deletions .github/workflows/sls-subscriber.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ name: Deploy subscriber service to prod
on:
push:
branches:
- change-this-to-main-to-deploy-on-push-to-main
- main
paths:
- subscriber/**
- .github/workflows/sls-subscriber.yaml

env:
SERVERLESS_ACCESS_KEY: ${{ secrets.SERVERLESS_ACCESS_KEY }}

jobs:
deploy:
name: Deploy
Expand Down Expand Up @@ -44,7 +41,5 @@ jobs:
run: |
serverless deploy \
--region ${{ vars.AWS_REGION }} \
--org ${{ vars.SLSORG }} \
--app ${{ vars.SLSAPP }} \
--stage ${{ vars.SLSSTAGE }} \
--verbose

0 comments on commit 7660f8a

Please sign in to comment.