Merge pull request #5 from cau-likelion-org/develop #9
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: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout source code. | |
uses: actions/checkout@v2 | |
- name: Check Node v | |
run: node -v | |
- name: Install Dependencies | |
run: yarn install --frozen-lockfile | |
- name: Build | |
run: yarn build | |
env: | |
NEXT_PUBLIC_SERVER_URL: ${{ secrets.NEXT_PUBLIC_SERVER_URL }} | |
- name: zip create | |
run: zip -qq -r ./build.zip . | |
shell: bash | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Upload to S3 | |
run: | | |
aws s3 cp --region ap-northeast-2 ./build.zip s3://startlion-frontend-bucket/build.zip | |
- name: Deploy | |
run: aws deploy create-deployment | |
--application-name startlion-frontend-codeDeploy | |
--deployment-config-name CodeDeployDefault.AllAtOnce | |
--deployment-group-name startlion-frontend-codeDeploy-group | |
--s3-location bucket=startlion-frontend-bucket,bundleType=zip,key=build.zip |