Skip to content

Commit

Permalink
chore: test script with test credentials (#5)
Browse files Browse the repository at this point in the history
* chore: test script with test credentials

* chore: update workflow node version

* chore: attempt fix

* chore: attempt fix

* chore: attempt fix

* chore: attempt fix

* chore: attempt fix

* chore: attempt fix

* chore: modify script

* chore: authenticate docker to ecr regisrty

* chore: cleanup script

* chore: run deployment on push to master
  • Loading branch information
Oluwatunmise-olat authored Jan 29, 2024
1 parent 2ea373b commit 51809b1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/pre-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Pre Deployment Script"

on:
push:
branches:
- master

jobs:
pre_deploy:
runs-on: ubuntu-latest
steps:
- name: Pull Repository
uses: actions/checkout@v2

- name: Setup and Install Node.Js
uses: actions/[email protected]
with:
node-version: "18.x"
cache: "yarn"

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Build Application
run: |
yarn run app:build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.REGION }}

- name: Build and Push Docker Image to Amazon ECR
run: |
aws ecr get-login-password --region ${{ secrets.REGION }} | docker login --username AWS --password-stdin ${{ secrets.REGISTRY_URL }}
docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REPOSITORY_NAME }}:latest -f Dockerfile .
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REPOSITORY_NAME }}:latest
- name: Deploy to Lambda
run: |
aws lambda update-function-code --function-name ${{ secrets.FUNCTION_NAME }} --image-uri ${{ secrets.REGISTRY_URL }}/${{ secrets.REPOSITORY_NAME }}:latest
1 change: 0 additions & 1 deletion src/modules/entrypoint/entrypoint.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { AWSSqs } from "@shared/utils/aws/sqs.util";
import { YoutubeDL } from "@shared/utils/youtube-dl/youtube-dl.util";

// TODO:: Prod ses access
// Post deployment script to build app, push to Aws ecr on merge or push to master and deploy to lambda
// Infra provisioning script (terraform)

@injectable()
Expand Down

0 comments on commit 51809b1

Please sign in to comment.