Skip to content

Commit

Permalink
[Feat] 클라이언트 배포 자동화 close #353
Browse files Browse the repository at this point in the history
  • Loading branch information
developerjhp committed Mar 24, 2022
1 parent 5e609c2 commit 08ac303
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: deploy-to-42ByteClientS3

on:
push:
branches: [deploy]

jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: git clone
uses: actions/checkout@v2

- name: npm install for eslint
run: npm install

- name: npm install
run: npm install
working-directory: ./client

- name: build
env:
REACT_APP_ACCESS_ID: ${{ secrets.REACT_APP_ACCESS_ID }}
REACT_APP_ACCESS_KEY: ${{ secrets.REACT_APP_ACCESS_KEY }}
REACT_APP_BUCKET_NAME: ${{ secrets.REACT_APP_BUCKET_NAME }}
REACT_APP_REGION: ${{ secrets.REACT_APP_REGION }}
REACT_APP_SERVERIP: ${{ secrets.REACT_APP_SERVERIP }}
run: CI='' npm run build
working-directory: ./client

- name: Transfer to S3 for serving static
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_IAM_MANAGER_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_IAM_MANAGER_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_BUCKET_REGION }}
SOURCE_DIR: '/home/runner/work/blind-42/42byte/client/build'

- name: 캐시 무효화
env:
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_IAM_MANAGER_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_IAM_MANAGER_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_BUCKET_REGION }}
run: aws cloudfront create-invalidation --distribution-id=E12HWSI28LDLX4 --paths "/*"

0 comments on commit 08ac303

Please sign in to comment.