mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-16 01:40:46 +08:00
Bumps the github-actions group in /.github/workflows with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [actions/download-artifact](https://github.com/actions/download-artifact). 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) --- 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 ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@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@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@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
|