add honorcert #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy GoEnergy-DOC site to Pages | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: pages | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Golang | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
# 安装 依赖 | |
- name: Install Dependencies | |
run: npm ci | |
# 构建后在 docs 目录 | |
- name: Build Github | |
run: npm run build:github | |
# 构建后在 site 目录 | |
- name: Build Site | |
run: npm run build | |
# 部署 pages energye.github.io | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./docs/ | |
# 上传网站 | |
- name: Upload site | |
env: | |
# 在github仓库当前项目配置设置 | |
AUTH_TOKEN: ${{ secrets.UPLOAD_SITE_AUTH_TOKEN }} | |
UPLOAD_URL: ${{ secrets.UPLOAD_SITE_URL }} | |
run: | | |
cd ./deploy | |
go build deploy.go | |
move deploy.exe ../ | |
cd ../ | |
dir | |
./deploy.exe -github=true -site=false | |
./deploy.exe -github=false -site=true | |
# 部署工作 | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
needs: build | |
runs-on: ubuntu-latest | |
name: Deploy | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |