Skip to content

Commit

Permalink
Merge pull request #4 from JohnsonMao/develop
Browse files Browse the repository at this point in the history
fix: github action and update doc
  • Loading branch information
JohnsonMao authored Apr 6, 2024
2 parents 6507001 + 7cc45ad commit b5d543e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -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}}
Expand All @@ -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
token: ${{ github.token }}
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,16 @@ The F2E 全台公車動態時刻查詢應用服務,以行動裝置的方向開
## 引用圖檔

Cover photo by <a href="https://unsplash.com/@malteesimo?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Malte Schmidt</a> on <a href="https://unsplash.com/s/photos/city?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>

## 環境變數

請新增 .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
```

0 comments on commit b5d543e

Please sign in to comment.