.gitlab-ci.yml 706 Bytes
Newer Older
Karakas's avatar
Karakas committed
1
image: node:18  # Use Node.js image for the pipeline
Karakas's avatar
test  
Karakas committed
2
3

stages:
Karakas's avatar
Karakas committed
4
  - build
Karakas's avatar
test  
Karakas committed
5
6
  - deploy

Karakas's avatar
Karakas committed
7
8
9
# Define jobs
build:
  stage: build
Karakas's avatar
test  
Karakas committed
10
  script:
Karakas's avatar
Karakas committed
11
12
13
    - cd frontend   # Change directory to the frontend folder
    - npm install   # Install dependencies
    - npm run build   # Build the React application
Karakas's avatar
test  
Karakas committed
14
15
  artifacts:
    paths:
Karakas's avatar
Karakas committed
16
      - frontend/build/   # Specify the artifacts to be passed to the next stage
Karakas's avatar
test  
Karakas committed
17

Karakas's avatar
Karakas committed
18
19
20
21
22
23
24
25
deploy:
  stage: deploy
  script:
    - echo "deploy to https://transfer.hft-stuttgart.de/pages/$CI_PROJECT_PATH/"
    # Add your deployment script here, for example:
    # - scp -r frontend/build/* user@your-server:/path/to/deploy
  only:
    - master   # Deploy only when changes are pushed to the master branch