Merge branch 'develop' of https://github.com/samtuap/dongsanginong-clโฆ #62
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 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 "/*" | |