相关疑难解决方法(0)

使用特定节点版本通过 Azure 部署静态 Web 应用程序

我正在尝试使用 Azure 服务和 Github Actions 来部署静态 Web 应用程序。

问题是,我需要使用 NodeJS 运行脚本。我正在使用 ESM 模块,这些模块在 Node v14 中运行良好。问题是,在构建任务期间,Azure(或github)使用v12.8(我猜是LTS),其中不支持ESM模块。

name: Azure Static Web Apps CI/CD

on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened, closed]
    branches:
      - master

jobs:
  build_and_deploy_job:

    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')

    runs-on: ubuntu-latest

    name: Build and Deploy Job

    steps:

      - uses: actions/checkout@v2
        with:
          submodules: true

      - name: Build And Deploy
        id: builddeploy
        uses: Azure/static-web-apps-deploy@v0.0.1-preview
        with:
          azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LEMON_GLACIER_0C510BD03 }}
          repo_token: ${{ …
Run Code Online (Sandbox Code Playgroud)

azure node.js github-actions

5
推荐指数
2
解决办法
2073
查看次数

标签 统计

azure ×1

github-actions ×1

node.js ×1