-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'fullstack-final' of https://github.com/ansuj9123/Full-S…
…tack-Project-Assessment into fullstack-final
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||