kind: pipeline
name: build

trigger:
  event:
    - push

steps:
  - name: build
    image: node:11
    pull: true
    group: build-static
    commands:
      - yarn --production=false
      - yarn clean
      - yarn build
      - yarn release
      - mv dist/*.tar.gz dist/vikunja-theme.tar.gz

  - name: release
    image: plugins/s3:1
    pull: true
    settings:
      bucket: vikunja-releases
      access_key:
        from_secret: aws_access_key_id
      secret_key:
        from_secret: aws_secret_access_key
      endpoint: https://s3.fr-par.scw.cloud
      region: fr-par
      path_style: true
      strip_prefix: dist/
      source: dist/vikunja-theme.tar.gz
      target: /theme/
    when:
      event: [ push ]
      branch: [ main ]
---
kind: pipeline
name: trigger-website-update

trigger:
  branch:
    - main
  event:
    - push

depends_on:
  - build

steps:
  - name: trigger
    image: plugins/downstream
    settings:
      server: https://drone.kolaente.de
      token:
        from_secret: drone_token
      repositories:
        - vikunja/website@main
        - vikunja/blog@main
