From dcf1666189802d4e49373570465942c4b9271c1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=9A=B0=EC=84=B1?= Date: Fri, 19 Jul 2024 11:42:19 +0900 Subject: [PATCH] =?UTF-8?q?[K5P-62]=20[cd]=20=EB=B0=B0=ED=8F=AC=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cd.yml | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..5385c9a --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,45 @@ +name: CD + +on: + push: + branches: + - prod + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: create env file + run: | + touch .env + echo "${{ secrets.ENV }}" >> .env + + - name: Setup Node.js environment + uses: actions/setup-node@v2.1.2 + + - name: Run a multi-line script + run: | + npm install + npm run build + + - name: S3 Sync + uses: jakejarvis/s3-sync-action@v0.5.1 + with: + args: --acl public-read --delete + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: 'ap-northeast-2' + SOURCE_DIR: 'dist' + + - name: Invalidate Cloudfront + uses: chetan/invalidate-cloudfront-action@v1.3 + env: + DISTRIBUTION: ${{ secrets.DISTRIBUTION }} + PATHS: '/*' + AWS_REGION: 'ap-northeast-2' + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} \ No newline at end of file