From c931c14075d8b313d42f768eb1d9c2db0215fb11 Mon Sep 17 00:00:00 2001 From: "kyj.dev" <110373659+youngjoonkim86@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:35:38 +0900 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..68f69c5 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,39 @@ +# master-deploy-work.yml +name: master + +on: + push: + branches: + - master # master 브랜치에서 push 이벤트가 일어났을 때 실행 + +jobs: + build: + runs-on: ubuntu-18.04 + steps: + - name: Checkout source code + uses: actions/checkout@master + + - name: Cache node modules # node modules 캐싱 + uses: actions/cache@v1 + with: + path: node_modules + key: ${{ runner.OS }}-master-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-build- + ${{ runner.OS }}- + + - name: Install Dependencies + run: yarn + + - name: Build + run: yarn build + + - name: Deploy + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + aws s3 cp \ + --recursive \ + --region ap-northeast-2 \ + build s3://프로젝트 이름