Skip to content

Commit

Permalink
commented out workflow files
Browse files Browse the repository at this point in the history
  • Loading branch information
stevem-zhou committed Dec 7, 2024
1 parent b9b25f7 commit a12fb49
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 172 deletions.
94 changes: 47 additions & 47 deletions .github/workflows/client-dev-CD.yml
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: ".*/*,*/*,**"
94 changes: 47 additions & 47 deletions .github/workflows/client-prod-CD.yml
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: ".*/*,*/*,**"
48 changes: 24 additions & 24 deletions .github/workflows/run-checks.yml
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
54 changes: 27 additions & 27 deletions .github/workflows/server-dev-CD.yml
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
# '
54 changes: 27 additions & 27 deletions .github/workflows/server-prod-CD.yml
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
# '

0 comments on commit a12fb49

Please sign in to comment.