Skip to content

Commit

Permalink
Merge branch 'fullstack-final' of https://github.com/ansuj9123/Full-S…
Browse files Browse the repository at this point in the history
…tack-Project-Assessment into fullstack-final
  • Loading branch information
ansuj9123 committed Feb 23, 2024
2 parents db5900d + 74494e6 commit fa419fb
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

name: Node.js CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- run: ls
- run: npm install
working-directory: client
- run: npm run build
working-directory: client
env:
CI: false

- uses: actions/upload-artifact@v3
with:
name: build-artifact
path: client/build/

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build-artifact
path: client/build
- name: Deploy to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp \
--recursive \
--region eu-west-2 \
client/build s3://my-youtube-site
30 changes: 30 additions & 0 deletions .github/workflows/backend-ec2-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

name: Deploy

on:
push:
branches: [ fullstack-final ]

jobs:
Deploy:
name: Deploy to EC2
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: ls
- name: SSH into EC2 and run commands
uses: appleboy/[email protected]
with:
host: 13.40.127.171
username: ubuntu
key: ${{ secrets.SSH_EC2_SECRET }}
script: |
echo "Hello, EC2!"
ls
cd Full-Stack-Project-Assessment/
git pull
cd server/
node server.js

0 comments on commit fa419fb

Please sign in to comment.