kind: pipeline
name: default

steps:
- name: backend
  image: plugins/docker
  settings:
    repo: privateregistry.michelescandura.com/michele/sledgemapper
    registry: privateregistry.michelescandura.com
    auto_tag: true

- name: frontend
  image: privateregistry.michelescandura.com/michele/basecompileimage
  volumes:
  - name: cache
    path: /release
  commands:
  - chmod +x build.sh
  - sh build.sh

- name: zip
  image: alpine:latest
  volumes:
  - name: cache
    path: /release
  commands:
  - apk update
  - apk add zip
  - cd /release/net5.0/win-x64
  - zip -r sledgemapper-win.zip ./publish
  - mkdir /release/zip
  - cp sledgemapper-win.zip /release/zip

- name: gitea_release
  image: plugins/gitea-release
  when:
    event:
    - tag
    branch:
      include:
      - master
  volumes:
  - name: cache
    path: /release
  settings:
    api_key: 96d2ba3da7491bd7760e2681f8882cf41f82e609
    base_url: https://git.michelescandura.com
    files: /release/zip/* 

volumes:
- name: cache
  temp: {}
