'Gitlab CI CD Production Config Unkown Keys

Gitlab CI CD Pipeline fails for the following yml with the error

obs:production config contains unknown keys: type

.gitlab-ci.yml

image: node:latest

before_script:
    - apt-get update -qy
    - apt-get install -y ruby-dev
    - gem install dpl

stages:
    - production

production:
    type: deploy
    stage: production
    image: ruby:latest
    script:
        - dpl --provider=heroku --app=$HEROKU_APP_PRODUCTION --api-key=$HEROKU_API_KEY
    only:
        - main


Solution 1:[1]

Job-defined types are deprecated and have been removed in GitLab 15. Use stage: instead.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 sytech