Files
MaaAssistantArknights/.github/workflows/website-workflow.yml
Rbqwow 3bb0833704 build: 更新文档主题库 (#11627)
* build: 更新网站依赖

* build:更新vphope版本

* build: 怎么忘记加这个了

* fix: 修复构建错误

* chore: fix Vite CJS Node API deprecated warning

* chore: log

* perf: turbo 添加文档 cache

* perf: 注释掉新版不读取的切换语言公告内容

但公告这个属性得留着 不留着就没有切换语言的弹窗了

* fix: 修复字体问题

* build: update package version

* docs: remove root locale

* docs: add author

* ci: update node version

* build: turbo一直叫我更新,于是我更新了

* docs: update package

* docs: 再见吧牛牛今晚我就要远航

* docs: fix root locale problem

* docs: remove unused command

* feat: 牛兮归来!

* build: update turbo

* chore: 语言提醒怎么又没了 加回来

---------

Co-authored-by: SherkeyXD <57581480+SherkeyXD@users.noreply.github.com>
2025-04-09 21:09:31 +08:00

108 lines
2.9 KiB
YAML

name: MaaWebsite Workflow
on:
push:
branches:
- "master"
- "dev"
paths:
- ".github/workflows/website-workflow.yml"
- "docs/**"
- "website/**"
pull_request:
paths:
- ".github/workflows/website-workflow.yml"
- "docs/**"
- "website/**"
workflow_dispatch:
inputs:
deploy-to-prod-env:
description: "Deploy to production environment"
default: false
required: true
type: boolean
jobs:
build:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
show-progress: false
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: "./website"
- name: Build
run: pnpm run build
working-directory: "./website"
- name: Upload artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: dist
path: "./website/dist"
publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request'
steps:
- name: Download website artifacts
uses: actions/download-artifact@v4
with:
name: dist
- name: Set deployment environment
id: set-deployment-env
run: |
if [[ "${{ github.event_name }}" != "workflow_dispatch" && "${{ github.ref }}" == "refs/heads/master" ]] || [[ "${{ github.event.inputs.deploy-to-prod-env }}" == "true" ]]; then
echo "AZURE_TARGET_ENV=prod" >> $GITHUB_ENV
else
echo "AZURE_TARGET_ENV=dev" >> $GITHUB_ENV
fi
- name: Show environment
run: echo ${{ env.AZURE_TARGET_ENV }}
- name: Deploy to Azure (prod)
id: deploy-prod
uses: Azure/static-web-apps-deploy@v1
if: env.AZURE_TARGET_ENV == 'prod'
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_MAA_WEBSITE }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
app_location: "."
api_location: ""
skip_app_build: true
skip_api_build: true
- name: Deploy to Azure (dev)
id: deploy-dev
uses: Azure/static-web-apps-deploy@v1
if: env.AZURE_TARGET_ENV == 'dev'
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_MAA_WEBSITE }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
action: "upload"
deployment_environment: dev
app_location: "."
api_location: ""
skip_app_build: true
skip_api_build: true