ターゲットを含むマルチサイト構成があります。 npx firebase-tools deploy --only hosting
またはnpx firebase-tools deploy --only hosting:bbbb
すると問題なく動作します。 しかし、新しいGitHubアクションを使用すると、次の行で失敗します。
/usr/local/bin/npx firebase-tools hosting:channel:deploy pr22-blah --expires 30d --project blah-dev --json
同じことをローカルで実行すると、同じように失敗します。 エラーは次のとおりです。
$ npx firebase-tools hosting:channel:deploy pr22-blah --only bbb --expires 30d --project blah-dev --json
{
"status": "error",
"error": "Hosting configs should only include either \"site\" or \"target\", not both."
}
そこで使用したコマンドは--only bbb
追加することに注意してください。 コマンドは、それがあってもなくても同じように失敗します。
また、私のfirebase.json
は"site"
がまったく表示されないことに注意してください。 下記参照:
.firebaserc:
{
"projects": {
"default": "blah-dev",
"dev": "blah-dev",
"prod": "blah-io"
},
"targets": {
"blah-io": {
"hosting": {
"aaa": [
"blah-aaa"
],
"boilerplate": [
"blah-boilerplate"
],
"bbb": [
"blah-bingo"
]
}
},
"blah-dev": {
"hosting": {
"aaa": [
"blah-aaa-dev"
],
"boilerplate": [
"blah-boilerplate-dev"
],
"bbb": [
"blah-bbb-dev"
]
}
}
}
}
firebase.json
{
"firestore": {...},
"database": {...},
"functions": {...},
"hosting": [
{
"target": "aaa",
"public": "packages/aaa/build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "boilerplate",
"public": "packages/boilerplate/build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
},
{
"target": "bbb",
"public": "packages/bbb/build",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
],
"emulators": {...}
}
firebase-tools : 。 npx firebase-tools --version
-> 8.14.0
プラットフォーム: OSXだけでなく、GitHubActionsのデフォルトイメージ
上記を参照。
上記を参照。 hosting:channel :deployコマンドを実行します
展開します
{
"status": "error",
"error": "Hosting configs should only include either \"site\" or \"target\", not both."
}
( --debug
フラグは、前面に多くのHTTPロギングノイズを追加しますが、それはすべて200です。)
報告ありがとうございます。 修正があり、できるだけ早く修正します。
チャネルを使用していないときにこのエラーが発生しますが、firebase deploy --only hosting:firebase deploy --only hosting:$CI_COMMIT_REF_SLUG -m "Tag $TAG Pipeline $CI_PIPELINE_ID, build $CI_BUILD_ID" --non-interactive
@ Mistic92は、詳細と複製手順を記載した新しい号を開いてください。
最も参考になるコメント
報告ありがとうございます。 修正があり、できるだけ早く修正します。