s3 cloudfront react app 배포

joDMSoluth·2020년 8월 9일
0

devops

목록 보기
1/4

깃 액션

# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
  push:
    branches: [dev]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
     # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: npm install #
        run: npm install #

      - name: build #
        env:
          AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.SECRET_ACCESS_KEY }}'

        run: npm run build # code build

      # Runs a set of commands using the runners shell
      - uses: chrislennon/action-aws-cli@v1.1
      - name: deploy
      # All commands after this point have access to the AWS CLI
        env:
          AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.SECRET_ACCESS_KEY }}'
        run: |
          npm run deploy

"build": "cross-env NODE_ENV=production next build && next export"
"deploy": "npx aws s3 sync ./out s3://nodelab.mixin"


나머지는 비활성


profile
풀스택이 되고 싶은 주니어 웹 개발자입니다.

0개의 댓글