Deploy #124
Workflow file for this run
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
name: Deploy | |
on: | |
workflow_dispatch: | |
branches: | |
- 'dev' | |
jobs: | |
ci: | |
name: Dev | |
runs-on: ubuntu-latest | |
env: | |
NEXT_PUBLIC_BASE_URL: ${{ secrets.BACKEND_BASE_URL }} | |
NEXT_PUBLIC_GA_ID: ${{ secrets.GA_ID }} | |
NEXT_PUBLIC_HJID: ${{ secrets.HOTJAR_HJID }} | |
NEXT_PUBLIC_HJSV: ${{ secrets.HOTJAR_HJSV }} | |
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }} | |
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }} | |
NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }} | |
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }} | |
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }} | |
NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} | |
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.FIREBASE_MESSAGING_MEASUREMENT_ID }} | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Run lint | |
run: pnpm lint | |
- name: Run Build | |
run: pnpm build | |
- name: Express Init | |
run: curl http://${{ secrets.HOST_DEV }}:8080/init | |
- name: 빌드 폴더 생성 | |
run: mkdir -p ./builds/ | |
- name: 빌드 파일을 압축 | |
run: tar -czv .next > ./builds/.next.tar.gz | |
- name: 빌드 파일을 EC2로 전송 | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.HOST_DEV }} | |
username: ${{ secrets.AWS_USER_NAME }} | |
key: ${{ secrets.AWS_DEV_KEY }} | |
source: './builds/.next.tar.gz' | |
target: '/home/${{ secrets.AWS_USER_NAME }}/' | |
- name: Express Deploy | |
run: curl http://${{ secrets.HOST_DEV }}:8080/deploy |