Summy
Summy

Reputation: 533

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,

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

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

Upvotes: 0

Views: 2529

Answers (1)

Cuong Vu
Cuong Vu

Reputation: 3723

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

Upvotes: 2

Related Questions