pipeline:
  run-playbooks:
    image: quay.io/ansible/ansible-runner:latest
    environment:
      - RUNNER_PLAYBOOK=main.yml
    commands:
      - mkdir env
      - echo $SSH_KEY | base64 -d > env/ssh_key
      - ansible-runner run `pwd`
    secrets: [ssh_key]

    when:
      branch: master
      event: push

  notify:
    image: registry.t-juice.club/plugin-gotify
    pull: true
    settings:
      gotify_url: https://gotify.t-juice.club
      gotify_token:
        from_secret: gotify_token
      title: redeployed ansible-nrec
      message: updated to ${CI_COMMIT_SHA:0:8}
    when:
      branch: master
      event: [push]