<p>i have an apps based on Node.js and i want to automation every step my deployment.
here my workflow.yml</p>
<pre><code>name: marketplace-ci

on:
  push:
    branches: [ master, staging ]
  pull_request:
    branches: [ master, staging ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js 12
    - uses: actions/setup-node@v1
      with:
        node-version: '12'
    - run:  npm ci
    - run:  npm run build --if-present
    - run: npm test
      
    - name: Cache npm
      uses: bahmutov/npm-install@v1
    - run: npm t
    
    - name: copy env
      run: cp stag.dockerfile Dockerfile
      
    - name: Configure AWS credentials
      uses: aws-actions/configure-aws-credentials@v1
      with:
        aws-access-key-id: ${{AWS_ACCOUNT_ID}}
        aws-secret-access-key: ${{AWS_SECRET_KEY}}
        aws-region: ap-southeast-1

    # login ECR
    - name: Login to Amazon ECR
      id: login-ecr
      uses: aws-actions/amazon-ecr-login@v1
      
    - name: Get short SHA
      id: slug
      run: echo &quot;::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)&quot;
      
    - name: Build and Push to ECR
    - uses: whoan/docker-build-with-cache-action@v5
      with:
        username: ${{AWS_ACCOUNT_ID}}
        password: ${{AWS_SECRET_KEY}}
        registry: ${{ steps.login-ecr.outputs.registry }}
        image_name: marketplace
        image_tag: &quot;stag-${{ steps.slug.outputs.sha8 }},staging&quot;
        
    - name: Get image name
      id: image
      run: echo &quot;::set-output name=image::${{ steps.login-ecr.outputs.registry }}/&lt;path url registry lo&gt;:prod-${{ steps.slug.outputs.sha8 }}&quot;

    - name: Build and push CONTAINER_NAME
      uses: ianbelcher/eks-kubectl-action@master
      with:
        aws_access_key_id: ${{AWS_ACCOUNT_ID}}
        aws_secret_access_key: ${{AWS_ACCOUNT_ID}}
        aws_region: ap-southeast-1
        cluster_name: stag-marketplace
        args: set image deployment/stag-marketplace stag-marketplace=${{ steps.image.outputs.image }}
</code></pre>
<p>and i have an error like this
<code>every step must define a `uses` or `run` key</code></p>
<p>please help me, thank you.</p>

Faisal Budiman
<p>As the error message says</p>
<pre><code>every step must define a `uses` or `run` key
</code></pre>
<p>Each step begins with a hyphen (<code>-</code>) and should contain <code>uses</code> or <code>run</code> keyword. Your workflow does not meet the requirements. For example, the fragment contains two steps</p>
<pre><code>- name: Use Node.js 12
- uses: actions/setup-node@v1
  with:
    node-version: '12'
</code></pre>
<p>The first one is invalid</p>
<pre><code>- name: Use Node.js 12
</code></pre>
<p>It does not contain <code>uses</code> or <code>run</code> so you get the error.</p>
<p>It should be</p>
<pre><code>- name: Use Node.js 12
  uses: actions/setup-node@v1
  with:
    node-version: '12'
</code></pre>
<p>or you can omit the name and it still will be valid</p>
<pre><code>- uses: actions/setup-node@v1
  with:
    node-version: '12'
</code></pre>
<p>You have also the same erroneous case in</p>
<pre><code>- name: Build and Push to ECR
- uses: whoan/docker-build-with-cache-action@v5
</code></pre>
<p>It should be</p>
<pre><code>- name: Build and Push to ECR
  uses: whoan/docker-build-with-cache-action@v5
</code></pre>
<p>or simply</p>
<pre><code>- uses: whoan/docker-build-with-cache-action@v5
</code></pre>
<p>As a rule, you cannot have a single <code>- name:</code> as the step definition. It should be followed either with <code>uses</code> or <code>run</code> without a hyphen as it's already added next to <code>name:</code>. A hyphen starts a new step and, as the error message says:</p>
<pre><code>every step must define a `uses` or `run` key
</code></pre>
