Skip to content

배포 수정 제발 돼라~~!!! #18

배포 수정 제발 돼라~~!!!

배포 수정 제발 돼라~~!!! #18

Workflow file for this run

name: Frontend_Upload_S3 # Workflow
on:
push:
branches:
- frontend
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code.
uses: actions/checkout@v2
- name: Check Node version
run: node -v
- name: Generate .env file
working-directory: ./frontend
env:
REACT_APP_ADDRESS: ${{ secrets.REACT_APP_ADDRESS }}
run: |
echo "REACT_APP_ADDRESS=$REACT_APP_ADDRESS" >> .env
- name: Install Dependencies
working-directory: ./frontend
run: npm install
- name: Build
working-directory: ./frontend
run: npm run build
env:
CI: ""
- name: zip create
working-directory: ./frontend/build
run: zip -qq -r ./build-fe.zip .
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
working-directory: ./frontend/build
run: |
aws s3 cp --region ap-northeast-2 ./build-fe.zip s3://keyword-on/build-fe.zip
- name: Deploy to EC2
run: aws deploy create-deployment
--application-name keyword-on-codedeploy
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name keyword-on-webservice-group
--s3-location bucket=keyword-on,key=build-fe.zip,bundleType=zip