Skip to content

Commit

Permalink
Merge pull request #24 from softeerbootcamp4th/develop
Browse files Browse the repository at this point in the history
Depoly version 0.0.0
  • Loading branch information
Dunkkkk authored Aug 12, 2024
2 parents c9119cb + ed5862a commit dc39125
Show file tree
Hide file tree
Showing 207 changed files with 52,398 additions and 1,610 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.cd.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy
on:
pull_request:
branches:
- develop
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Install dependencies including TypeScript, React, and Vite
run: npm install --save-dev typescript @types/react @types/react-dom vite @vitejs/plugin-react @types/node
working-directory: ./Caecae

- name: Install other dependencies with Yarn
run: yarn install
working-directory: ./Caecae

- name: Build project
run: npm run build
working-directory: ./Caecae
45 changes: 45 additions & 0 deletions .github/workflows/ci.cd.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Check Node.js version
run: node -v

- name: Install dependencies including TypeScript, React, and Vite
run: npm install --save-dev typescript @types/react @types/react-dom vite @vitejs/plugin-react @types/node
working-directory: ./Caecae

- name: Install other dependencies with Yarn
run: yarn install
working-directory: ./Caecae

- name: Build project
run: npm run build
working-directory: ./Caecae

- name: Create zip file
run: zip -qq -r ./build.zip .
working-directory: ./Caecae

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Upload to S3
run: |
aws s3 cp --region ap-northeast-2 ./build.zip s3://caecae-s3bucket/build.zip
working-directory: ./Caecae

- name: Deploy with CodeDeploy
run: aws deploy create-deployment --application-name caecae-codeDeploy --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name caecae-codeDeploy-group --s3-location bucket=caecae-s3bucket,bundleType=zip,key=build.zip
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Created by https://www.toptal.com/developers/gitignore/api/react,yarn
# Edit at https://www.toptal.com/developers/gitignore?templates=react,yarn

### build file ###
dist

### webserverKey ###
*.pem

### react ###
.DS_*
*.log
Expand Down Expand Up @@ -151,4 +157,3 @@ dist
# temporary folders
.tmp/
temp/

1 change: 1 addition & 0 deletions Caecae/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
Expand Down
16 changes: 16 additions & 0 deletions Caecae/appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/deploy
overwrite: yes
permissions:
- object: /home/ubuntu/deploy
owner: root
group: root
mode: 755
hooks:
AfterInstall:
- location: deploy.sh
timeout: 1000
runas: root
5 changes: 5 additions & 0 deletions Caecae/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
REPOSITORY=/home/ubuntu/deploy

cd $REPOSITORY

sudo service nginx restart
2 changes: 1 addition & 1 deletion Caecae/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/App/main.tsx"></script>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading

0 comments on commit dc39125

Please sign in to comment.