deploy via surge.sh github action template
1.0.0
一個簡單的 Github Actions 模板,用於使用 Surge.sh 部署靜態站點
示範-> https://test-github-action-surge.surge.sh/
步驟 1取得部署令牌
步驟 2在儲存庫機密標籤中設定 2 個機密
SURGE_TOKEN -> 您的 Surge 代幣 123abc123abc123abc
SURGE_DOMAIN -> 您想要在 https://test-github-action-surge.surge.sh 上發佈網站的網域
步驟 3在儲存庫的 .github/workflows 資料夾中新增新的 Github Action
name: Deploy Website
on: [push]
jobs:
build:
runs-on: ubuntu-latest
name: Deploying to surge
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install -g surge
- run: surge ./ ${{ secrets.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}
步驟 4透過提交進行測試