简体   繁体   English

Github 操作工作流错误:您的 yaml 语法有错误

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

I am trying to deploy to google cloud engine using github actions and my yaml config is as follows,我正在尝试使用 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

and github actions is throwing me the below error和 github 动作给我下面的错误

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

fyi, line #10 is - uses: actions/checkout@v2仅供参考,第 10 行是- uses: actions/checkout@v2

The steps indentation level is incorrect, it should be inside deploy 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