Merge pull request #118 from fun-eat/feat/v2 #7
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: Frontend Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
checks: write | |
pull-requests: write | |
steps: | |
- name: Repository 체ν¬μμ | |
uses: actions/checkout@v3 | |
- name: Node μ€μ | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.16.1' | |
- name: node_modules μΊμ± | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: μμ‘΄μ± μ€μΉ | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --pure-lockfile | |
- name: .env νμΌ μμ± | |
run: | | |
echo "CHANNEL_TALK_KEY=${{ secrets.CHANNEL_TALK_KEY }}" > .env | |
echo "GOOGLE_ANALYTICS_ID=${{ secrets.GOOGLE_ANALYTICS_ID }}" >> .env | |
- name: ν΄λΌμ΄μΈνΈ λΉλ | |
run: yarn build | |
- name: AWS CLI μ€μ | |
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: ap-northeast-2 | |
- name: S3 μ΄μ νμΌ μμ | |
run: | | |
aws s3 rm ${{ secrets.AWS_S3_URL }} --recursive | |
- name: S3μ λ°°ν¬ | |
run: | | |
aws s3 sync ./dist ${{ secrets.AWS_S3_URL }} |