【发布时间】:2020-10-20 05:43:45
【问题描述】:
我正在尝试使用 Github 操作将我的 Angular 应用程序部署到 Firebase 托管。我正在使用this 操作来完成此操作。我的release.yml 文件如下所示:
name: Release
on:
push:
branches:
- master
jobs:
firebase-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: '14.x'
- run: npm install
- run: npm run build --prod
- uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
但是,当我将其提交到 master 分支时,我收到以下错误:
错误:必须在每个“托管”配置中提供“站点”或“目标”。
我不知道这个错误是什么意思,所以任何帮助都会很棒。谢谢!
编辑:我的 firebase.json 如下所示:
{
"hosting": [
{
"public": "MyName",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "projectName",
"public": "dist/projectName",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
]
}
【问题讨论】:
-
您有多个托管站点吗?您需要在 firebase.json 中指定部署目标。 firebase.google.com/docs/cli/…
-
见我编辑的答案@cwlau
标签: angular firebase firebase-hosting github-actions