24 lines
526 B
Ruby
24 lines
526 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module OceanicWs
|
||
|
class GithubWebhooksController < ActionController::API
|
||
|
include GithubWebhook::Processor
|
||
|
|
||
|
def github_push(payload)
|
||
|
if payload[:ref].starts_with?("refs/tags/")
|
||
|
BuildOceanicDocsJob.perform_later(:tag, payload)
|
||
|
elsif payload[:ref] == "refs/heads/dev"
|
||
|
BuildOceanicDocsJob.perform_later(:dev, payload)
|
||
|
end
|
||
|
|
||
|
head(204)
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def webhook_secret(_payload)
|
||
|
Websites.config.github_webhook_secret
|
||
|
end
|
||
|
end
|
||
|
end
|