Skip to content

Commit

Permalink
chore: ci 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
ssojungg committed Jan 17, 2024
1 parent c022b9c commit 82e08ac
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Node.js CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USERNAME: ${{ secrets.DB_USERNAME }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_DATABASE: ${{ secrets.DB_DATABASE }}
DB_PORT: ${{ secrets.DB_PORT }}
NODE_DOCKER_PORT: ${{ secrets.NODE_DOCKER_PORT }}
GMAIL_OAUTH_USER: ${{ secrets.GMAIL_OAUTH_USER }}
GMAIL_OAUTH_CLIENT_ID: ${{ secrets.GMAIL_OAUTH_CLIENT_ID }}
GMAIL_OAUTH_CLIENT_SECRET: ${{ secrets.GMAIL_OAUTH_CLIENT_SECRET }}
GMAIL_OAUTH_REFRESH_TOKEN: ${{ secrets.GMAIL_OAUTH_REFRESH_TOKEN }}
AWS_S3_SECRET_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}
AWS_S3_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_S3_REGION: ${{ secrets.AWS_S3_REGION }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
PEXELS_API_KEY: ${{ secrets.PEXELS_API_KEY }}

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install Dependencies
run: npm install

- name: Build
run: npm run build --if-present

- name: Lint
run: npm run lint

- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
- name: Upload to AWS S3
if: success() # 이전 단계가 성공했을 경우에만 실행
run: |
aws s3 cp ./build s3://${{ secrets.AWS_BUCKET }}/ --recursive
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_S3_REGION }}

0 comments on commit 82e08ac

Please sign in to comment.