From 0ad1f430f71e0522eec64ab83ad558552d71d7d1 Mon Sep 17 00:00:00 2001 From: hwmin414 Date: Thu, 18 Jan 2024 21:24:42 +0900 Subject: [PATCH] feat: zabo build deploy to s3 --- .github/workflows/prod-build-deploy-s3.yaml | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/prod-build-deploy-s3.yaml diff --git a/.github/workflows/prod-build-deploy-s3.yaml b/.github/workflows/prod-build-deploy-s3.yaml new file mode 100644 index 0000000..8dd3d7c --- /dev/null +++ b/.github/workflows/prod-build-deploy-s3.yaml @@ -0,0 +1,45 @@ +name: Build src on release tag created and deploy to s3(cloudfront) + +on: + # push: + # tags: + # - "**" + push: + branches: + - "develop" + +jobs: + build: + name: Build and push static to s3 cloudfront + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Cache node modules # node modules 캐싱 + uses: actions/cache@v1 + id: yarn-cache + with: + path: node_modules + key: ${{ runner.OS }}-master-build-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.OS }}-build- + ${{ runner.OS }}- + - if: steps.yarn-cache.outputs.cache-hit == 'true' + run: echo 'yarn cache hit!' + - if: steps.yarn-cache.outputs.cache-hit != 'true' + run: echo 'yarn cache missed!' + + - 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://zabo.staging.sparcs.org \ No newline at end of file