我试图使用Github Actions将我的Angular应用程序部署到Firebase托管。为了实现这一目的,我使用了此操作。我的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
分支时,出现以下错误:
错误:必须在每个“hosting”配置中提供“site”或“target”之一。
我不知道这个错误是什么意思,所以任何帮助都将是极好的。谢谢!
编辑:我的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"
}
]
}
]
}