generated from ctc-uci/npo-template-merged
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9b25f7
commit a12fb49
Showing
5 changed files
with
172 additions
and
172 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 |
---|---|---|
@@ -1,53 +1,53 @@ | ||
# client-dev-CD.yml | ||
# # client-dev-CD.yml | ||
|
||
name: S3 Dev Deploy | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
env: | ||
NODE_ENV: ${{ secrets.NODE_ENV }} | ||
VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }} | ||
VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }} | ||
VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }} | ||
VITE_FIREBASE_STORAGEBUCKET: ${{ secrets.VITE_FIREBASE_STORAGEBUCKET }} | ||
VITE_FIREBASE_MESSAGINGSENDERID: ${{ secrets.VITE_FIREBASE_MESSAGINGSENDERID }} | ||
VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }} | ||
VITE_BACKEND_HOST: ${{ secrets.VITE_BACKEND_HOST }} | ||
# …and any additional environment variables | ||
# name: S3 Dev Deploy | ||
# on: | ||
# push: | ||
# branches: | ||
# - dev | ||
# env: | ||
# NODE_ENV: ${{ secrets.NODE_ENV }} | ||
# VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }} | ||
# VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }} | ||
# VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }} | ||
# VITE_FIREBASE_STORAGEBUCKET: ${{ secrets.VITE_FIREBASE_STORAGEBUCKET }} | ||
# VITE_FIREBASE_MESSAGINGSENDERID: ${{ secrets.VITE_FIREBASE_MESSAGINGSENDERID }} | ||
# VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }} | ||
# VITE_BACKEND_HOST: ${{ secrets.VITE_BACKEND_HOST }} | ||
# # …and any additional environment variables | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
# jobs: | ||
# run: | ||
# runs-on: ubuntu-latest | ||
# env: | ||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
# steps: | ||
# - name: Checkout repo | ||
# uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
# - name: Setup Node | ||
# uses: actions/setup-node@v3 | ||
|
||
- name: Install dependencies | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
# - name: Install dependencies | ||
# uses: borales/actions-yarn@v4 | ||
# with: | ||
# cmd: install | ||
|
||
- name: Build | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: build | ||
# - name: Build | ||
# uses: borales/actions-yarn@v4 | ||
# with: | ||
# cmd: build | ||
|
||
- name: Deploy | ||
uses: reggionick/s3-deploy@v4 | ||
with: | ||
folder: dist | ||
bucket: ${{ secrets.S3_BUCKET }} | ||
bucket-region: ${{ secrets.S3_BUCKET_REGION }} | ||
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | ||
invalidation: / | ||
delete-removed: true | ||
no-cache: true | ||
private: true | ||
files-to-include: ".*/*,*/*,**" | ||
# - name: Deploy | ||
# uses: reggionick/s3-deploy@v4 | ||
# with: | ||
# folder: dist | ||
# bucket: ${{ secrets.S3_BUCKET }} | ||
# bucket-region: ${{ secrets.S3_BUCKET_REGION }} | ||
# dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | ||
# invalidation: / | ||
# delete-removed: true | ||
# no-cache: true | ||
# private: true | ||
# files-to-include: ".*/*,*/*,**" |
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 |
---|---|---|
@@ -1,53 +1,53 @@ | ||
# client-dev-CD.yml | ||
# # client-dev-CD.yml | ||
|
||
name: S3 Prod Deploy | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
env: | ||
NODE_ENV: ${{ secrets.NODE_ENV }} | ||
VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }} | ||
VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }} | ||
VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }} | ||
VITE_FIREBASE_STORAGEBUCKET: ${{ secrets.VITE_FIREBASE_STORAGEBUCKET }} | ||
VITE_FIREBASE_MESSAGINGSENDERID: ${{ secrets.VITE_FIREBASE_MESSAGINGSENDERID }} | ||
VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }} | ||
VITE_BACKEND_HOST: ${{ secrets.VITE_BACKEND_HOST }} | ||
# …and any additional environment variables | ||
# name: S3 Prod Deploy | ||
# on: | ||
# push: | ||
# branches: | ||
# - dev | ||
# env: | ||
# NODE_ENV: ${{ secrets.NODE_ENV }} | ||
# VITE_FIREBASE_APIKEY: ${{ secrets.VITE_FIREBASE_APIKEY }} | ||
# VITE_FIREBASE_AUTHDOMAIN: ${{ secrets.VITE_FIREBASE_AUTHDOMAIN }} | ||
# VITE_FIREBASE_PROJECTID: ${{ secrets.VITE_FIREBASE_PROJECTID }} | ||
# VITE_FIREBASE_STORAGEBUCKET: ${{ secrets.VITE_FIREBASE_STORAGEBUCKET }} | ||
# VITE_FIREBASE_MESSAGINGSENDERID: ${{ secrets.VITE_FIREBASE_MESSAGINGSENDERID }} | ||
# VITE_FIREBASE_APPID: ${{ secrets.VITE_FIREBASE_APPID }} | ||
# VITE_BACKEND_HOST: ${{ secrets.VITE_BACKEND_HOST }} | ||
# # …and any additional environment variables | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
# jobs: | ||
# run: | ||
# runs-on: ubuntu-latest | ||
# env: | ||
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
# steps: | ||
# - name: Checkout repo | ||
# uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
# - name: Setup Node | ||
# uses: actions/setup-node@v3 | ||
|
||
- name: Install dependencies | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: install | ||
# - name: Install dependencies | ||
# uses: borales/actions-yarn@v4 | ||
# with: | ||
# cmd: install | ||
|
||
- name: Build | ||
uses: borales/actions-yarn@v4 | ||
with: | ||
cmd: build | ||
# - name: Build | ||
# uses: borales/actions-yarn@v4 | ||
# with: | ||
# cmd: build | ||
|
||
- name: Deploy | ||
uses: reggionick/s3-deploy@v4 | ||
with: | ||
folder: dist | ||
bucket: ${{ secrets.S3_BUCKET }} | ||
bucket-region: ${{ secrets.S3_BUCKET_REGION }} | ||
dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | ||
invalidation: / | ||
delete-removed: true | ||
no-cache: true | ||
private: true | ||
files-to-include: ".*/*,*/*,**" | ||
# - name: Deploy | ||
# uses: reggionick/s3-deploy@v4 | ||
# with: | ||
# folder: dist | ||
# bucket: ${{ secrets.S3_BUCKET }} | ||
# bucket-region: ${{ secrets.S3_BUCKET_REGION }} | ||
# dist-id: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} | ||
# invalidation: / | ||
# delete-removed: true | ||
# no-cache: true | ||
# private: true | ||
# files-to-include: ".*/*,*/*,**" |
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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
name: Run Checks | ||
# name: Run Checks | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
# on: | ||
# push: | ||
# branches: ["main"] | ||
# pull_request: | ||
# branches: ["main"] | ||
|
||
jobs: | ||
run-checks: | ||
runs-on: ubuntu-latest | ||
# jobs: | ||
# run-checks: | ||
# runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
cache: "yarn" | ||
# - name: Use Node.js 18 | ||
# uses: actions/setup-node@v4 | ||
# with: | ||
# node-version: "18" | ||
# cache: "yarn" | ||
|
||
- name: Install dependencies | ||
run: | ||
npm exec --workspaces -- npx rimraf node_modules && npx rimraf | ||
node_modules && yarn install --frozen-lockfile | ||
# - name: Install dependencies | ||
# run: | ||
# npm exec --workspaces -- npx rimraf node_modules && npx rimraf | ||
# node_modules && yarn install --frozen-lockfile | ||
|
||
- name: Build React project | ||
run: cd client && yarn run build | ||
# - name: Build React project | ||
# run: cd client && yarn run build | ||
|
||
- name: Run linter | ||
run: cd client && yarn run lint && cd ../ && cd server && yarn run lint | ||
# - name: Run linter | ||
# run: cd client && yarn run lint && cd ../ && cd server && yarn run lint |
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 |
---|---|---|
@@ -1,33 +1,33 @@ | ||
# server-dev-CD.yml | ||
# # server-dev-CD.yml | ||
|
||
name: EC2 Dev Deploy | ||
# name: EC2 Dev Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
# on: | ||
# push: | ||
# branches: | ||
# - dev | ||
|
||
jobs: | ||
Deploy: | ||
runs-on: ubuntu-latest | ||
# 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 }} | ||
# 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} ' | ||
# 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 | ||
' | ||
# #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 | ||
# ' |
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 |
---|---|---|
@@ -1,33 +1,33 @@ | ||
# server-prod-CD.yml | ||
# # server-prod-CD.yml | ||
|
||
name: EC2 Prod Deploy | ||
# name: EC2 Prod Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
# on: | ||
# push: | ||
# branches: | ||
# - dev | ||
|
||
jobs: | ||
Deploy: | ||
runs-on: ubuntu-latest | ||
# 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 }} | ||
# 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} ' | ||
# 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 | ||
' | ||
# #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 | ||
# ' |