---
kind: pipeline
type: docker
name: w17 remote Deployment

platform:
  os: linux
  arch: amd64

steps:
- name: build
  image: nixos/nix
  volumes:
  - name: public
    path: /public
  enviroment:
  commands: 
  - export QT_QPA_PLATFORM="offscreen"
  - export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d)/"
  - rm -rf /public/*
  - cp -R imgs /public/imgs
  - cp w17.tmx /public
  - cd /public
  - nix run nixpkgs.tiled -c tiled --export-map json w17.tmx w17.json

volumes: 
  - name: public
    host:
      path: /var/www/public/w17