Skip to content

Commit

Permalink
etc: front배포 환경변수 파일 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
5nxtnxtnxt committed Dec 12, 2023
1 parent 7468902 commit 6e6a56d
Showing 1 changed file with 49 additions and 45 deletions.
94 changes: 49 additions & 45 deletions .github/workflows/TestFrontNginx.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
name: Deploy Frontend To Nginx Test

on:
push:
branches: [ "FE/main" ]
push:
branches: ["FE/main"]

workflow_dispatch:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.5.1

- name: Check Node v
run: node -v

- name: Install dependencies
working-directory: ./front
run: npm install

- name: Generate build
working-directory: ./front
run: npm run build

- name: List contents of ./front/dist
run: ls -la ./front/dist

- name: Remove build folder in the server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
rm -rf /usr/share/nginx/build
- name: Deploy to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
password: ${{ secrets.SERVER_PASSWORD }}
source: front/dist
target: /usr/share/nginx/build
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.5.1

- name: Check Node v
run: node -v

- name: Install dependencies
working-directory: ./front
run: npm install

- name: .env init
working-directory: ./front
run: echo VITE_APP_SENTRY_DSN = ${{ secrets.SENTRY_DSN }} >> .env

- name: Generate build
working-directory: ./front
run: npm run build

- name: List contents of ./front/dist
run: ls -la ./front/dist

- name: Remove build folder in the server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
rm -rf /usr/share/nginx/build
- name: Deploy to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
password: ${{ secrets.SERVER_PASSWORD }}
source: front/dist
target: /usr/share/nginx/build

0 comments on commit 6e6a56d

Please sign in to comment.