这是我的管道
bitbucket-pipelines.yml
image: atlassian/default-image:latest
options:
docker: true
size: 2x
pipelines:
branches:
dev:
- step:
name: Deploy to test
deployment: test
caches:
- node
script:
- pipe: microsoft/azure-static-web-apps-deploy:main
variables:
APP_LOCATION: "$BITBUCKET_CLONE_DIR/"
OUTPUT_LOCATION: "$BITBUCKET_CLONE_DIR/web-build"
API_TOKEN: $deployment_token
APP_BUILD_COMMAND: npx expo export:web
definitions:
services:
docker:
memory: 4096
我尝试先创建工件,然后通过
microsoft/azure-static-web-apps-deploy:main
管道进行部署,但它也不起作用。
image: node:16-alpine
options:
docker: true
size: 2x
pipelines:
branches:
dev:
- step:
name: Build and Test
caches:
- node
script:
- npm install yarn
- yarn
- npx expo export:web
artifacts:
- web-build/**
- step:
name: Deploy to test
deployment: test
script:
- pipe: microsoft/azure-static-web-apps-deploy:main
variables:
APP_LOCATION: "$BITBUCKET_CLONE_DIR/"
OUTPUT_LOCATION: "$BITBUCKET_CLONE_DIR/web-build"
API_TOKEN: $deployment_token
SKIP_APP_BUILD: "true"
definitions:
services:
docker:
memory: 4096
我建议采取以下步骤:
Azure 帐户设置: Azure 静态 Web 应用资源: 存储库配置: Azure 静态 Web 应用配置: 构建配置: GitHub Actions 或 Azure Pipelines: CI/CD 配置: 秘密和环境变量: 触发部署: 监控部署: 调试: 迭代和完善:
由于您使用的是 Bitbucket 而不是 GitHub,因此由于 CI/CD 系统的差异,某些步骤可能会略有不同。请务必查阅有关 Bitbucket 集成的 Azure 静态 Web 应用文档,并浏览 Azure Pipelines 文档以设置 Bitbucket 存储库的 CI/CD。