'CI CD ionic Project . Configuring gitlab-ci.yml?

I want to configure a gitlab-ci.yml file for an ionic projects and still confusing .

  • what's the main stages for every projects for the CI CD configuration?
  • difference between the build and the deploy stages?
  • how can implement a build stage for ionic project?

this is my try for the gitlab-ci.yml in my project:

stages:
  - test
  - deploy

build_web:
  image: node:latest
  stage: test 
  only:
      - main
  script:
    - npm install
    - npm run lint
    - npm run test
    - npm run build
    - npm run e2e
    - npm run deploy

build_ios:
  stage: deploy
  only:
    - release 
  script:
    - ./ionic-login.sh
    - ls
    - npm run ios:release:ci
    - ./ionic-package-ios.sh

build_android:
  stage: deploy
  only:
    - release
  script:
    - ls
    - npm run android:release
    - ls ./platforms/android/build/outputs/apk/android*.apk
  artifacts:
    paths:
      - platforms/android/build/outputs/apk/


Sources

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

Source: Stack Overflow

Solution Source