Skip to content

Merge branch 'develop' of https://github.com/samtuap/dongsanginong-clโ€ฆ #62

Merge branch 'develop' of https://github.com/samtuap/dongsanginong-clโ€ฆ

Merge branch 'develop' of https://github.com/samtuap/dongsanginong-clโ€ฆ #62

name: deploy to aws s3
# main ๋ธŒ๋žœ์น˜์— push ๋  ๋•Œ ํ˜„์žฌ ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰ trigger ๋ฐœ๋™.
on:
push:
branches:
- develop
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: source code checkout
uses: actions/checkout@v2
- name: setup node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: npm install
working-directory: .
# run ์€ ์ง์ ‘ ์‚ฌ์šฉํ•˜๊ณ ์ž ํ•˜๋Š” ๋ช…๋ น์–ด.
run: npm install
- name: npm build
env:
VUE_APP_API_BASE_URL: ${{ secrets.BASE_URL }}
VUE_APP_MY_URL: ${{ secrets.MY_URL }}
VUE_APP_KAKAO_REDIRECT_URI: ${{ secrets.KAKAO_REDIRECT_URI }}
VUE_APP_KAKAO_CLIENT_ID: ${{ secrets.KAKAO_CLIENT_ID }}
VUE_APP_GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }}
VUE_APP_GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
VUE_APP_GOOGLE_REDIRECT_URI: ${{ secrets.GOOGLE_REDIRECT_URI}}
VUE_APP_PORTONE_STORE_ID: ${{ secrets.PORTONE_STORE_ID }}
VUE_APP_PORTONE_CHANNEL_KEY: ${{ secrets.PORTONE_CHANNEL_KEY }}
VUE_APP_FIREBASE_VAPID_KEY: ${{ secrets.FIREBASE_VAPID_KEY }}
VUE_APP_FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
working-directory: .
run: npm run build
- name: setup aws cli
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
aws-region: "ap-northeast-2"
# ๊ธฐ์กด ์ง€์šฐ๊ณ  ๋นŒ๋“œ ๋„ฃ์–ด์ฃผ๊ธฐ
- name: clear s3 bucket
run: aws s3 rm s3://www.inong.shop/ --recursive
- name: deploy to s3 bucket
run:
aws s3 cp ./dist s3://www.inong.shop/ --recursive
- name: invalidate cloudfront cache
run:
aws cloudfront create-invalidation --distribution-id E311EUF9PYKNKB --paths "/*"