我在Azure应用服务中使用基本的默认配置,在构建时没有警告和错误。
部署也成功了,但最新的更改没有显示在生产中,仍然显示以前的构建。
这是我用来将构建推送到Azure应用程序服务中的脚本
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: Build and deploy Node.js app to Azure Web App - AppName
on:
push:
branches:
- stage
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: npm install, build
run: |
npm install
CI=false npm run build-stage
- name: Create zip archive
run: zip -r node-app.zip .
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: node-app
path: node-app.zip
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: node-app
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'AppName'
slot-name: 'Production'
publish-profile: ${{ My profile key }}
package: .
- 我已经清除了浏览器中的该高速缓存,也在隐身模式下尝试过。
- 已重新启动应用程序服务
1条答案
按热度按时间wlsrxk511#
在本地进行任何更改后,请确保使用以下命令将更改推送到Github存储库:
在Repository中推送更改后,* 您可以在Deployment Center中单击
Sync button
,重新运行工作流,如下所示:-*您也可以在Github操作标签中重新运行Deployment,如下所示:
请参考我的SO线程答案到通过Github操作成功部署React应用。