Skip to content

Update README.md

Update README.md #61

Workflow file for this run

# ๋ฉ”์ธ ๋ธŒ๋žœ์น˜์— ํ‘ธ์‹œ ๋ฐœ์ƒ ์‹œ ์‹คํ–‰๋จ
name: Publish
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@main
# Github Repository Secrets ์ด์šฉํ•ด ๋ฆฌ์•กํŠธ ํŒŒ์ผ ๋‚ด ํ™˜๊ฒฝ ๋ณ€์ˆ˜ ํŒŒ์ผ ์ƒ์„ฑ
- name: Generate Environment Variables File for Production
run: |
echo "REACT_APP_IMGUR_URL=$REACT_APP_IMGUR_URL" >> .env.production
echo "REACT_APP_IMGUR_CLIENT_ID=$REACT_APP_IMGUR_CLIENT_ID" >> .env.production
echo "REACT_APP_IMGUR_CLIENT_PWD=$REACT_APP_IMGUR_CLIENT_PWD" >> .env.production
echo "REACT_APP_SERVER_URL=$REACT_APP_SERVER_URL" >> .env.production
echo "REACT_APP_GOOGLE_OAUTH_SERVER=$REACT_APP_GOOGLE_OAUTH_SERVER" >> .env.production
echo "REACT_APP_GOOGLE_OAUTH_REDIRECT_URL=$REACT_APP_GOOGLE_OAUTH_REDIRECT_URL" >> .env.production
echo "REACT_APP_KAKAO_TOKEN=$REACT_APP_KAKAO_TOKEN" >> .env.production
env:
REACT_APP_IMGUR_URL: ${{ secrets.REACT_APP_IMGUR_URL }}
REACT_APP_IMGUR_CLIENT_ID: ${{ secrets.REACT_APP_IMGUR_CLIENT_ID }}
REACT_APP_IMGUR_CLIENT_PWD: ${{secrets.REACT_APP_IMGUR_CLIENT_PWD}}
REACT_APP_SERVER_URL: ${{secrets.REACT_APP_SERVER_URL}}
REACT_APP_GOOGLE_OAUTH_SERVER: ${{secrets.REACT_APP_GOOGLE_OAUTH_SERVER}}
REACT_APP_GOOGLE_OAUTH_REDIRECT_URL: ${{secrets.REACT_APP_GOOGLE_OAUTH_REDIRECT_URL}}
REACT_APP_KAKAO_TOKEN: ${{secrets.REACT_APP_KAKAO_TOKEN}}
# package-lock.json์˜ ๋ณ€๊ฒฝ ์‚ฌํ•ญ์— ๋งค๋ฒˆ ํŒจํ‚ค์ง€ ์ƒˆ๋กญ๊ฒŒ ์„ค์น˜ํ•˜์ง€ ์•Š๊ณ  ์บ์‹ฑ ์ง„ํ–‰
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
# package-lock.json ์บ์‹ฑ ๊ฒฐ๊ณผ์— ๋”ฐ๋ฅธ ํŒจํ‚ค์ง€ ์„ค์น˜
- name: Install
run: npm install
# ๋นŒ๋“œ ์ƒ์„ฑ
- name: Build
run: npm run build
# AWS S3 ๋ฒ„ํ‚ท ๋‚ด ๋นŒ๋“œ ํŒŒ์ผ ์—…๋กœ๋“œ
- 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://${{ secrets.AWS_S3_Bucket_Name }}
# cloudFront ๋‚ด ์ €์žฅ๋œ ์บ์‹œ ๋ฌดํšจํ™”ํ•˜์—ฌ ์ƒˆ๋กœ์šด ๋ฆฌ์†Œ์Šค๊ฐ€ ์—…๋ฐ์ดํŠธ ๋˜๋„๋ก ํ•จ
- name: Invalidate CloudFront Cache
uses: chetan/invalidate-cloudfront-action@master
env:
AWS_REGION: ap-northeast-2
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }}
PATHS: '/index.html'
continue-on-error: true