gh-pages 部署问题,作业部署失败。您尝试部署的目录...不存在
gh-pages deployment issue, job fails on deploy. The directory you're trying to deploy ... doesn't exist
gh-pages 部署失败并出现下一个错误:My repository failed job
Checking configuration and starting deployment…
Error: The directory you're trying to deploy named /home/runner/work/azure-flask-react/azure-flask-react/dist doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗
Deployment failed! ❌
我正在尝试在 Github 部署 ReactApp 并且除了部署 Python-Flask 后端 托管在 Azure 和后台应用程序有其自动 生成作业yml.
但是对于 front-app 我遵循 this answer 并在 yml 中手动添加了第二个作业,因为我需要提供 env.variables.
我的后端部署成功,但前端应用程序由于路径重复而不断失败
/home/runner/work/azure-flask-react/azure-flask-react/dist
Here is my yml and package.json 但没有任何额外提及该目录...
# 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 Python app to Azure Web App - first-py-app
on:
push:
branches:
- main
workflow_dispatch:
jobs:
front-build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: |
npm --prefix front-app install
npm --prefix front-app run-script build
env:
REACT_DEV_SERVER_URL: ${{ secrets.REACT_DEV_SERVER_URL }},
REACT_DEV_FRONT_APP_URL: ${{ secrets.REACT_DEV_FRONT_APP_URL }}
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_KEY }}
BRANCH: gh-pages
FOLDER: dist
back-build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python version
uses: actions/setup-python@v1
with:
python-version: '3.8'
- name: Build using AppService-Build
uses: azure/appservice-build@v2
with:
platform: python
platform-version: '3.8'
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
with:
app-name: 'first-py-app'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_7edcdecca83a4354a87943f94bb32fca }}
{
...
"homepage": "https://nikonov91-dev.github.io/azure-flask-react",
"scripts": {
...
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
}
和我的文件结构
azure-proj
|-front-app (containing reactjs)
|-package.json
|-node_modules
|-src
|-app.py (python-flask application which deploys successfully)
我误解了问题消息,问题不是重复,问题是 FOLDER 在 gh-pages YML 设置[=29] 中传递的丢失的内部路径=]
BUILD步骤中有提示
还有一件事:不要忘记获取并添加到 GH 您的 personal-access-token
gh-pages 部署失败并出现下一个错误:My repository failed job
Checking configuration and starting deployment…
Error: The directory you're trying to deploy named /home/runner/work/azure-flask-react/azure-flask-react/dist doesn't exist. Please double check the path and any prerequisite build scripts and try again. ❗
Deployment failed! ❌
我正在尝试在 Github 部署 ReactApp 并且除了部署 Python-Flask 后端 托管在 Azure 和后台应用程序有其自动 生成作业yml.
但是对于 front-app 我遵循 this answer 并在 yml 中手动添加了第二个作业,因为我需要提供 env.variables.
我的后端部署成功,但前端应用程序由于路径重复而不断失败 /home/runner/work/azure-flask-react/azure-flask-react/dist
Here is my yml and package.json 但没有任何额外提及该目录...
# 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 Python app to Azure Web App - first-py-app
on:
push:
branches:
- main
workflow_dispatch:
jobs:
front-build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: |
npm --prefix front-app install
npm --prefix front-app run-script build
env:
REACT_DEV_SERVER_URL: ${{ secrets.REACT_DEV_SERVER_URL }},
REACT_DEV_FRONT_APP_URL: ${{ secrets.REACT_DEV_FRONT_APP_URL }}
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_KEY }}
BRANCH: gh-pages
FOLDER: dist
back-build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python version
uses: actions/setup-python@v1
with:
python-version: '3.8'
- name: Build using AppService-Build
uses: azure/appservice-build@v2
with:
platform: python
platform-version: '3.8'
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v2
with:
app-name: 'first-py-app'
slot-name: 'production'
publish-profile: ${{ secrets.AzureAppService_PublishProfile_7edcdecca83a4354a87943f94bb32fca }}
{
...
"homepage": "https://nikonov91-dev.github.io/azure-flask-react",
"scripts": {
...
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
}
和我的文件结构
azure-proj
|-front-app (containing reactjs)
|-package.json
|-node_modules
|-src
|-app.py (python-flask application which deploys successfully)
我误解了问题消息,问题不是重复,问题是 FOLDER 在 gh-pages YML 设置[=29] 中传递的丢失的内部路径=]
BUILD步骤中有提示
还有一件事:不要忘记获取并添加到 GH 您的 personal-access-token