mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 09:50:40 +08:00
* ci: bump the github-actions group across 1 directory with 7 updates Bumps the github-actions group with 7 updates in the /.github/workflows directory: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `4` | `5` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `4` | `5` | | [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `2.3.2` | `2.3.3` | | [actions/github-script](https://github.com/actions/github-script) | `7` | `8` | | [actions/setup-python](https://github.com/actions/setup-python) | `5` | `6` | | [actions/stale](https://github.com/actions/stale) | `9` | `10` | | [actions/setup-node](https://github.com/actions/setup-node) | `4` | `5` | Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) Updates `actions/download-artifact` from 4 to 5 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) Updates `softprops/action-gh-release` from 2.3.2 to 2.3.3 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v2.3.2...v2.3.3) Updates `actions/github-script` from 7 to 8 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v7...v8) Updates `actions/setup-python` from 5 to 6 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5...v6) Updates `actions/stale` from 9 to 10 - [Release notes](https://github.com/actions/stale/releases) - [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/stale/compare/v9...v10) Updates `actions/setup-node` from 4 to 5 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: softprops/action-gh-release dependency-version: 2.3.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/github-script dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-python dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/stale dependency-version: '10' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-node dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> * ci: fix schema --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Constrat <56174894+Constrat@users.noreply.github.com>
116 lines
3.1 KiB
YAML
116 lines
3.1 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@v5
|
|
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@v5
|
|
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@v5
|
|
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 GitHub Pages
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
if: env.AZURE_TARGET_ENV == 'prod'
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: "."
|
|
publish_branch: gh-pages
|
|
|
|
- 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
|