pipeline:
  build:
    image: archlinux
    commands:
      - pacman -Syu --noconfirm hugo git
      - hugo --destination /woodpecker/build/vrifox.cc/ --minify --cleanDestinationDir

  upload: 
    image: archlinux
    commands:
      - pacman -Syu --noconfirm openssh rsync
      - mkdir -p /root/.ssh
      - echo "$SSH_KEY" > /root/.ssh/id_ed25519
      - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
      - rsync -rv -e "ssh -p $SSH_PORT -i /root/.ssh/id_ed25519" /woodpecker/build/ woodpecker@$SSH_HOST:/home/woodpecker/build/vrifox.cc/ --checksum
    secrets: [ ssh_key, ssh_port, ssh_host ]

branches: [ main, cicd ]