diff --git a/.github/workflows/deploy-to-gh-pages.yml b/.github/workflows/deploy-to-gh-pages.yml
index 530d04c..f1e5f58 100644
--- a/.github/workflows/deploy-to-gh-pages.yml
+++ b/.github/workflows/deploy-to-gh-pages.yml
@@ -1,19 +1,39 @@
name: Build and Deploy
+
on:
push:
branches:
- main
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
jobs:
build-and-deploy:
+ name: Build and Deploy to GitHub pages
runs-on: ubuntu-latest
+ timeout-minutes: 10
+
steps:
- name: Checkout 🛎️
- uses: actions/checkout@v2.3.1
+ uses: actions/checkout@v3
+
+ - name: Set up Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: '20.x'
+
+ - name: Set up PNPM
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
- name: Install and Build 🔧
run: |
- yarn
- yarn build
+ pnpm install
+ pnpm build
env:
VITE_CLIENT_ID: ${{ secrets.VITE_CLIENT_ID}}
VITE_CLIENT_SECRET: ${{ secrets.VITE_CLIENT_SECRET}}
@@ -22,7 +42,6 @@ jobs:
VITE_MAP_TOKEN: ${{ secrets.VITE_MAP_TOKEN}}
- name: Deploy 🚀
- uses: JamesIves/github-pages-deploy-action@4.1.5
+ uses: actions/deploy-pages@v1
with:
- branch: gh-pages
- folder: build
\ No newline at end of file
+ token: ${{ github.token }}
\ No newline at end of file
diff --git a/README.md b/README.md
index 8d0f784..f2b4c6e 100644
--- a/README.md
+++ b/README.md
@@ -43,3 +43,16 @@ The F2E 全台公車動態時刻查詢應用服務,以行動裝置的方向開
## 引用圖檔
Cover photo by Malte Schmidt on Unsplash
+
+## 環境變數
+
+請新增 .env 檔案並填入
+
+```bash
+VITE_CLIENT_ID= # TDX Client ID
+VITE_CLIENT_SECRET= # TDX Client Secret
+VITE_MAP_USERNAME= # MapBox Username
+VITE_MAP_STYLE_ID= # MapBox style ID
+VITE_MAP_TOKEN= # MapBox token
+```
+