Skip to content

Commit

Permalink
feat: ci/cd & cors
Browse files Browse the repository at this point in the history
  • Loading branch information
astorverse committed Feb 1, 2025
1 parent 31fbbd3 commit 5ce2fb8
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Deploy to EC2
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.USER }}@${{ secrets.HOST }} << EOF
cd ~/astorverse-api
git fetch origin
git reset --hard origin/main
sudo docker compose pull
sudo docker compose up -d
EOF
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lerna-debug.log*
.env.test.local
.env.production.local
.env.local

.env.prod
# temp directory
.temp
.tmp
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
api:
container_name: handybus-api-dev
container_name: astorverse-api
restart: always
image: node:20.11.0
working_dir: /usr/src/app
Expand All @@ -10,4 +10,4 @@ services:
- .:/usr/src/app
- /usr/src/app/node_modules
ports:
- '3010:3000'
- '3000:3000'
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "astoir-api",
"name": "astorverse-api",
"version": "0.0.1",
"description": "",
"author": "",
Expand Down
10 changes: 7 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ import cookieParser from 'cookie-parser';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors({
origin: ['http://localhost:4321'],
origin: [
'http://localhost:4321',
'https://astorverse.com',
'https://www.astorverse.com',
],
credentials: true,
});
app.use(cookieParser());
const config = new DocumentBuilder()
.setTitle('Astoir API')
.setDescription('Astoir API 문서')
.setTitle('Astorverse API')
.setDescription('Astorverse API 문서')
.setVersion('1.0')
.build();

Expand Down

0 comments on commit 5ce2fb8

Please sign in to comment.