rm -rf old dir when building docs & fix branch generation
This commit is contained in:
parent
709bdda97b
commit
02c2c42d49
@ -7,8 +7,8 @@ module OceanicWs
|
|||||||
def github_push(payload)
|
def github_push(payload)
|
||||||
if payload[:ref].starts_with?("refs/tags/")
|
if payload[:ref].starts_with?("refs/tags/")
|
||||||
BuildOceanicDocsJob.perform_later(:tag, payload)
|
BuildOceanicDocsJob.perform_later(:tag, payload)
|
||||||
elsif payload[:ref] == "refs/heads/dev"
|
elsif payload[:ref].starts_with?("refs/heads/")
|
||||||
BuildOceanicDocsJob.perform_later(:dev, payload)
|
BuildOceanicDocsJob.perform_later(:branch, payload)
|
||||||
end
|
end
|
||||||
|
|
||||||
head(204)
|
head(204)
|
||||||
|
@ -15,6 +15,7 @@ class BuildOceanicDocsJob < ApplicationJob
|
|||||||
FileUtils.rm("#{dir}/.npmrc")
|
FileUtils.rm("#{dir}/.npmrc")
|
||||||
system("npx pnpm install --ignore-scripts --frozen-lockfile", exception: true)
|
system("npx pnpm install --ignore-scripts --frozen-lockfile", exception: true)
|
||||||
system("npx pnpm run test:docs", exception: true)
|
system("npx pnpm run test:docs", exception: true)
|
||||||
|
FileUtils.rm_rf("/data/oceanic-docs/#{name}")
|
||||||
FileUtils.cp_r("#{dir}/docs", "/data/oceanic-docs/#{name}")
|
FileUtils.cp_r("#{dir}/docs", "/data/oceanic-docs/#{name}")
|
||||||
Cache.redis.sadd("oceanic:versions", name)
|
Cache.redis.sadd("oceanic:versions", name)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user