1

Expanding on what I'm trying to accomplish:

  • After committing code to a locally-hosted Git server, a Drone pipeline is to test, then build, and finally deploy a React project on said server.

Limitations:

  • I have minimal React & pipeline experience
  • Keeping everything locally hosted (Gitea, Drone, etc)
  • KISS, preferably a single pipeline building, deploying, and taking down a previous container once new code is pushed
  • I've seen similar guides recommending Docker registries to push the container to, but I'm similarly falling short on implementation/guidance

Where I'm falling short:

  • Said React project is being built, but am unsure as to how to proceed to deploying.

Current pipeline:

# .drone.yml
kind: pipeline
type: docker
name: example-build
trigger:
  branch:
    - master
  event:
    - push
steps:
  - name: build-static-files
    image: node:latest
    commands:
      - pwd
      - whoami
      - ls -al /drone
      - ls -al /drone/src
      - npm i socket.io-client @types/socket.io-client
      - chmod 777 -R ./node_modules/
      - npm run build
jumacs
  • 11
  • 2

1 Answers1

0

CI pipelines should be kept typically to build and push image to a container registry. Deployment should be done via principles like GitOps.

Having said that it's no harm adding a deploy step. A deploy step may vary depending up on where you want to deploy:

e.g. With an example application https://github.com/kameshsampath/drone-fruits-app-demo you can deploy

I hope that gives you some idea to craft your pipelines.

Kamesh
  • 115
  • 11