Skip to content

Commit

Permalink
Merge pull request #92 from DeveloperRyou/develop
Browse files Browse the repository at this point in the history
FIX: action으로 backend브랜치 자동배포, backend
  • Loading branch information
DeveloperRyou authored Jun 9, 2024
2 parents ca18fcc + 9924842 commit 615fee0
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Run eollugage-fe development deploy

on:
push:
branches:
- develop

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 21

- name: Cache yarn
uses: actions/cache@v3
id: yarn-cache
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

# cache hit 못하면 패키지 설치
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install

- name: Run build test
run: yarn build

push-to-develop-backend:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout develop-backend branch # 'main' 브랜치로 branch checkout
uses: actions/checkout@v2
with:
ref: "develop-backend"
fetch-depth: "0"
submodules: true

- name: Configure Git # commit을 위한 git config 설정
run: |
git config user.name action
- name: Merge dev branch # develop 브랜치를 merge
run: |
git merge origin/develop --no-edit
- name: Push changes to main branch # merge 내용들을 main 브랜치로 최종 push
uses: ad-m/github-push-action@master
with:
branch: develop-backend
github_token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- develop

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion src/apis/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getTokenFromLocalStorage = () => {
return accessToken;
};

const eollugageUrl = "https://api.eolluga.com";
const eollugageUrl = process.env.NEXT_PUBLIC_BACKEND_URL;

const api = axios.create({
baseURL: eollugageUrl,
Expand Down

0 comments on commit 615fee0

Please sign in to comment.