cache:
  paths:
    - ./ghost-upload/target/
    - ./ghost-upload/cargo/

publish:
  stage: deploy
  image: rust:latest
  script:
    - cd ./ghost-upload
    - cargo run
  needs:
    - job: deploy
      optional: true
    - job: staging
      optional: true

# Manual trigger to force update all Ghost posts
force-update-ghost:
  stage: deploy
  image: rust:latest
  script:
    - echo "🔄 Force updating all Ghost posts..."
    - cd ./ghost-upload
    - FORCE_UPDATE=true cargo run
  needs:
    - job: deploy
      optional: true
    - job: staging
      optional: true
  rules:
    - when: manual
      allow_failure: false
  variables:
    FORCE_UPDATE: "true"
