Merge pull request #112 from next-petree/boilerPlate #120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
# 'boilerPlate' λΈλμΉμ νΈμλ λ μν¬νλ‘μ°λ₯Ό μ€ν | |
on: | |
push: | |
branches: | |
- main | |
# μμ μ μ | |
jobs: | |
build: | |
# μ΄ μμ μ μ°λΆν¬ μ΅μ λ²μ μμ μ€ν | |
runs-on: ubuntu-latest | |
steps: | |
# 1λ¨κ³: λ ν¬μ§ν 리 μ½λ 체ν¬μμ | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
# 2λ¨κ³: μ°λΆν¬ λ²μ μ νμΈ (μ ν) | |
- name: Check Ubuntu version | |
run: lsb_release -a | |
# 3λ¨κ³: νκ²½ λ³μ νμΌ μμ± | |
- name: Create env file | |
run: | | |
touch .env | |
echo REACT_APP_API_URL=${{ secrets.REACT_APP_API_URL }} >> .env | |
echo REACT_APP_KAKAO_REST_API=${{ secrets.REACT_APP_KAKAO_REST_API }} >> .env | |
echo REACT_APP_KAKAO_REDIRECT_URI=${{ secrets.REACT_APP_KAKAO_REDIRECT_URI }} >> .env | |
cat .env | |
# 4λ¨κ³: νλ‘μ νΈ μμ‘΄μ±μ μ€μΉ | |
- name: Install dependencies | |
run: npm install | |
# 5λ¨κ³: νλ‘μ νΈλ₯Ό λΉλ | |
- name: Build | |
run: npm run build | |
# 6λ¨κ³: AWS CLI λ²μ νμ(μ ν) | |
- name: SHOW AWS CLI VERSION | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: aws --version | |
# 7λ¨κ³: λΉλ νμΌμ S3 λ²ν·μ λκΈ°ν. | |
- name: Sync Bucket | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: | | |
aws s3 sync \ | |
--region ap-northeast-2 \ | |
build s3://nextpetree.store\ | |
--delete |