Skip to content

Commit

Permalink
chore: 移除 .env.production 並加入 .gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysq-qi committed Nov 20, 2024
1 parent 6b6c3e5 commit ee8b66d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/frontend-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,26 @@ jobs:
with:
node-version: 20 # 使用 Node.js 版本 20。

# 3. 安裝依賴項
# 3. 設置環境變數並生成 .env.production
- name: Set environment variables
run: |
echo "REACT_APP_BASENAME=${{ secrets.REACT_APP_BASENAME }}" >> .env.production
echo "REACT_APP_API_URL=${{ secrets.REACT_APP_API_URL }}" >> .env.production
# 4. 安裝依賴項
- name: Install dependencies
run: npm install

# 4. 動態添加 homepage 欄位至 package.json
# 5. 動態添加 homepage 欄位至 package.json
- name: Add homepage field dynamically
run: |
node -e "let pkg=require('./package.json'); pkg.homepage='https://ysq-qi.github.io/sideproject2405/'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));"
# 5. 建置專案
# 6. 建置專案
- name: Build project
run: npm run build

# 6. 部署至 GitHub Pages
# 7. 部署至 GitHub Pages
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
.env.test.local
.env.production.local
.env
.env.production
.env.backend

npm-debug.log*
Expand Down

0 comments on commit ee8b66d

Please sign in to comment.