【发布时间】:2021-08-05 04:21:48
【问题描述】:
我创建了一个工作流来构建反应应用到生产环境。
name: Build and Deploy
on:
push:
branches:
- main
jobs:
build:
name: Build
env:
REACT_APP_ENV: live build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: build
path: build
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: build
path: build
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting:production
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
构建作业正在正确运行。但是对于部署,我得到了这个错误
错误:没有活动项目,但项目别名可用。
使用以下选项之一运行 firebase 使用:
我的.firebaserc 文件
{
"projects": {
"production": "gottamenu-admin",
"development":"gotta-menu-ap"
}
}
我按照 Firebase 存储库中的说明进行 GitHub 操作
如果您有多个托管环境,您可以在 args 行中指定哪一个。例如args: deploy --only hosting:[环境名称]
这就是为什么我把args: deploy --only hosting:production
如何在 GitHub 操作中修复此错误?
【问题讨论】:
标签: reactjs firebase github devops github-actions