[Feature] 장소 입력하기 api 연동 #189
Workflow file for this run
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: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.10.0' | |
- name: Set Yarn Version | |
id: set-version | |
run: | | |
corepack enable | |
yarn set version 4.5.1 | |
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT | |
- name: Yarn Cache - PnP | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.yarn/cache | |
.pnp.* | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}- | |
- name: Install Dependencies | |
run: yarn install | |
- name: Set Environment Variables | |
run: | | |
echo "VITE_BACKEND_URL=${{ secrets.VITE_BACKEND_URL }}" >> $GITHUB_ENV | |
echo "VITE_KAKAO_REST_API_KEY=${{ secrets.VITE_KAKAO_REST_API_KEY }}" >> $GITHUB_ENV | |
echo "VITE_KAKAO_JAVASCRIPT_KEY=${{ secrets.VITE_KAKAO_JAVASCRIPT_KEY }}" >> $GITHUB_ENV | |
- name: Build | |
run: yarn build | |
cd: | |
needs: ci | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event_name == 'pull_request' && github.base_ref == 'main' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20.10.0' | |
- name: Set Yarn Version | |
id: set-version | |
run: | | |
corepack enable | |
yarn set version 4.5.1 | |
echo "YARN_VERSION=$(yarn -v)" >> $GITHUB_OUTPUT | |
- name: Yarn Cache - PnP | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.yarn/cache | |
.pnp.* | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ steps.set-version.outputs.YARN_VERSION }} | |
restore-keys: | | |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}- | |
- name: Install Dependencies | |
run: yarn install | |
- name: Set Environment Variables | |
run: | | |
echo "VITE_BACKEND_URL=${{ secrets.VITE_BACKEND_URL }}" >> $GITHUB_ENV | |
echo "VITE_KAKAO_REST_API_KEY=${{ secrets.VITE_KAKAO_REST_API_KEY }}" >> $GITHUB_ENV | |
echo "VITE_KAKAO_JAVASCRIPT_KEY=${{ secrets.VITE_KAKAO_JAVASCRIPT_KEY }}" >> $GITHUB_ENV | |
- name: Build | |
run: yarn build | |
- name: Deploy to S3 | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
SOURCE_DIR: ${{ secrets.SOURCE_DIR }} |