Skip to content

Commit

Permalink
OV-86: + base cd config
Browse files Browse the repository at this point in the history
  • Loading branch information
sofiia-trokhymchuk committed Aug 29, 2024
1 parent eff3c86 commit c1f0fcb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Continuous Delivery

env:
AWS_REGION: us-north-1
EBS_APP_NAME: bsa-2024-outreachvids
ENVIRONMENT: next

on:
push:
branches:
- task/OV-86-add-deployment
workflow_dispatch:

jobs:
cd:
runs-on: ubuntu-latest

steps:
- name: Checkout Source Code
uses: actions/checkout@v3
with:
node-version: .nvmrc

- name: Zipping
run: |
zip -r build.zip . -x .github
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v21
with:
use_existing_version_if_available: true
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }}
region: ${{ env.AWS_REGION }}
application_name: ${{ env.EBS_APP_NAME }}
environment_name: ${{ env.ENVIRONMENT }}
version_label: ${{ github.sha }}
deployment_package: ./build.zip
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"build:shared": "npm run build -w shared",
"build:frontend": "npm run build -w frontend",
"build:backend": "npm run build -w backend",
"build": "npm run build:shared && npm run build:backend && npm run build:frontend && sh ./prepare-build.sh",
"lint:editor": "editorconfig-checker",
"lint:fs": "ls-lint",
"lint:type": "npm run lint:type --workspaces --if-present",
Expand All @@ -25,7 +26,9 @@
"lint:format": "prettier --check \"**/*.{ts,tsx,json,md,scss,html,yml}\"",
"lint": "npm run lint:editor && npm run lint:fs && npm run lint:format && npm run lint:type && npm run lint:js && npm run lint:css",
"lint:fix": "npm run lint:fix -w frontend && npm run lint:fix -w backend",
"format": "prettier --write \"**/*.{ts,tsx,json,md,css,html,yml}\""
"format": "prettier --write \"**/*.{ts,tsx,json,md,css,html,yml}\"",
"prestart": "npm install --include=dev && npm run build",
"start": "cd ./build/backend && npm run start"
},
"devDependencies": {
"@commitlint/cli": "19.4.0",
Expand Down
5 changes: 5 additions & 0 deletions prepare-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
mkdir -p ./build/backend; mv ./backend/build/* ./build/backend
mkdir ./build/backend/public; mv ./frontend/build/* ./build/backend/public
cp ./backend/package.json ./build/backend
cp package.json package-lock.json ./build

0 comments on commit c1f0fcb

Please sign in to comment.