Skip to content

Commit

Permalink
[K5P-62] [cd] 배포 스크립트 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
dtd1614 committed Jul 19, 2024
1 parent 06ad829 commit dcf1666
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]

- name: Run a multi-line script
run: |
npm install
npm run build
- name: S3 Sync
uses: jakejarvis/[email protected]
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/[email protected]
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 }}

0 comments on commit dcf1666

Please sign in to comment.