Skip to content

Commit

Permalink
Edit README.md and add template CD.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jrock-3 committed Feb 29, 2024
1 parent 62bd25f commit 9b4636e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: EC2 Deploy

on:
push:
branches: [dev-deployment]

jobs:
Deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Deploy in EC2
env:
PRIVATE_KEY: ${{ secrets.AWS_EC2_PRIVATE_KEY }}
HOSTNAME : ${{ secrets.AWS_EC2_HOSTNAME }}
USER: ${{ secrets.AWS_EC2_USER }}

run: |
echo "$PRIVATE_KEY" > private_key.pem && chmod 600 private_key.pem
ssh -o StrictHostKeyChecking=no -i private_key.pem ${USER}@${HOSTNAME} '
#Now we have got the access of EC2 and we will start the deploy .
cd ~/npo-backend-template &&
git checkout dev &&
git stash &&
git pull origin dev &&
yarn &&
pm2 restart app.js
'
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ This template will be used to create all NPO backend repos

To start working on with this project, follow these steps:
1. Install the [EditorConfig plugin](https://editorconfig.org/#download) for your IDE.
1. Add the `.env` file stored in your projects Google Drive folder to the root of the project.
1. Install NodeJS and yarn following the [instructions here](https://classic.yarnpkg.com/lang/en/docs/install).
1. Navigate to the project folder in your terminal and run `yarn` to install required packages.
2. Install NodeJS and yarn following the [instructions here](https://classic.yarnpkg.com/lang/en/docs/install).
3. Configure environment variables with `dotenv-vault` ([install here](https://www.dotenv.org/docs#getting-started)) following [instructions here](https://www.dotenv.org/docs/quickstart/sync#pull-env).
4. Navigate to the project folder in your terminal and run `yarn` to install required packages.

## Project branching structure

Expand Down

0 comments on commit 9b4636e

Please sign in to comment.