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通过提交进行测试