簡體   English   中英

Github 操作工作流錯誤:您的 yaml 語法有錯誤

[英]Github actions workflow error: You have an error in your yaml syntax

我正在嘗試使用 github 操作和我的 yaml 配置部署到谷歌雲引擎,如下所示,

name: "Deploy to GAE"
on:
  push:
    branches: [production]
jobs:
  deploy:
    runs-on: ubuntu-latest
  
  steps:
  - uses: actions/checkout@v2
  - name: Install Dependencies
    run: composer install -n --prefer-dist
  - name: Generate key
    run: php artisan key:generate
  - name: GCP Authenticate
    uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
    with:
      version: "273.0.0"
      service_account_key: ${{ secrets.GCP_SA_KEY }}
  - name: Set GCP_PROJECT
    env:
      GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
    run: gcloud --quiet config set project ${GCP_PROJECT}
  - name: Deploy to GAE
    run: gcloud app deploy app.yaml

和 github 動作給我下面的錯誤

Invalid workflow file: .github/workflows/main.yml#L10
You have an error in your yaml syntax on line 10

僅供參考,第 10 行是- uses: actions/checkout@v2

steps縮進級別不正確,應該在deploy里面

name: "Deploy to GAE"
on:
  push:
    branches: [production]
jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Install Dependencies
        run: composer install -n --prefer-dist
      - name: Generate key
        run: php artisan key:generate
      - name: GCP Authenticate
        uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
        with:
          version: "273.0.0"
          service_account_key: ${{ secrets.GCP_SA_KEY }}
      - name: Set GCP_PROJECT
        env:
          GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
        run: gcloud --quiet config set project ${GCP_PROJECT}
      - name: Deploy to GAE
        run: gcloud app deploy app.yaml

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM