diff --git a/.drone.yml b/.drone.yml index e97e0a7..1530ce6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,60 +2,73 @@ kind: pipeline name: hugo type: docker platform: - os: linux - arch: arm64 + os: linux + arch: arm64 trigger: - branch: - - master + branch: + - master steps: ####### DOCKER BUILD AND PUSH TO REGISTRY ######## -- name: build docker image and push to registry - image: plugins/docker - volumes: - - name: appsource - path: "/src" - - name: dockersock - path: "/var/run/docker.sock" - settings: - debug: true - username: - from_secret: REGISTRY_USER - password: - from_secret: REGISTRY_PASSWORD - registry: "dockerregistry.gregandev.fr" - insecure: true - privileged: true - repo: "greglebreton/terminal-cv" - dockerfile: ./Dockerfile +# - name: build docker image and push to registry +# image: plugins/docker +# volumes: +# - name: appsource +# path: "/src" +# - name: dockersock +# path: "/var/run/docker.sock" +# settings: +# debug: true +# username: +# from_secret: REGISTRY_USER +# password: +# from_secret: REGISTRY_PASSWORD +# registry: "dockerregistry.gregandev.fr" +# insecure: true +# privileged: true +# repo: "greglebreton/terminal-cv" +# dockerfile: ./Dockerfile ######## NPM BROKEN ######## -# - name: install npm dependancies -# image: node -# commands: -# - npm install -# - npm test +- name: install npm dependancies + image: node + commands: + - npm install + - npm build + + +- name: deploy on server + image: drillster/drone-rsync + settings: + hosts: ["192.168.1.101"] + target: /workspace/terminal-cv/site + source: ./dist/* + port: 2021 + user: + from_secret: RSYNC_USER + key: + from_secret: RSYNC_STACK_KEY ######## TELEGRAM NOTIFICATION ######## - name: notification - image: appleboy/drone-telegram - settings: - token: - from_secret: TELEGRAM_TOKEN - to: - from_secret: TELEGRAM_USERID - message: > - 📝 {{repo.name}} / {{commit.branch}} - {{commit.message}} - {{#success build.status}} - ✅ succeeded for 👷‍♂️ build {{build.number}} - {{else}} - 🛑 failed for 👷‍♂️ build {{build.number}} - {{/success}} - when: - status: - - failure - - success \ No newline at end of file + image: appleboy/drone-telegram + settings: + token: + from_secret: TELEGRAM_TOKEN + to: + from_secret: TELEGRAM_USERID + message: > + 📝 {{repo.name}} / {{commit.branch}} - {{commit.message}} + {{#success build.status}} + ✅ succeeded for 👷‍♂️ build {{build.number}} + {{else}} + 🛑 failed for 👷‍♂️ build {{build.number}} + {{/success}} + when: + status: + - failure + - success