Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GitHub ActionsでZennの記事を限定公開する

GitHub ActionsでZennの記事を限定公開する

Fukuoka.rb 0x100 回 LT 大会 (#256)での登壇資料です。
https://fukuokarb.connpass.com/event/245647/

D1dd88d67a1b17b9d2ad981b75d205f3?s=128

M-Yamashita

May 11, 2022
Tweet

More Decks by M-Yamashita

Other Decks in Programming

Transcript

  1. 2022-05-11 Fukuoka.rb 0x100 ճ LT େձ GitHub ActionsͰZennͷهࣄΛݶఆެ։͢Δ M-Yamashita

  2. ࣗݾ঺հ • ࢁԼ խਓ • όοΫΤϯυΤϯδχΞ@෱Ԭ • ࢓ࣄͷRailsྺ: 2೥ఔ౓ •

    GitHub: @M-Yamashita01 • Twitter: @M_Yamashii
  3. ࿩͢͜ͱ GitHub Actions + Cloud RunͰ ZennͷهࣄΛݶఆެ։͢Δ

  4. ॻ͍ͨهࣄΛಛఆͷਓ͚ͨͪͩʹݟ͍ͤͨʂ ͦΜͳܦݧ͋Γ·ͤΜ͔ʁ ͬͦ͘͞Ͱ͕͢

  5. ࢲ͸࠷ۙͦͷܦݧʹग़ձ͍·ͨ͠

  6. • ओʹZennΛ࢖͍Ruby΍RailsͳͲʹؔ͢ΔهࣄΛΞοϓ͖ͯͨ͠ • Zennʹ౤ߘ͖ͯͨ͠هࣄ͸ɺެࣜαΠτ΍ެ։͞Ε͍ͯΔ৘ใ͔Β
 ݸਓͰௐࠪ͠·ͱΊͨ΋ͷ͕΄ͱΜͲ ࠓ·Ͱ

  7. • ٕज़هࣄͷࣥචʹ͋ͨΓɺଞͷํʹެࣜϦϑΝϨϯεʹؔ͢Δ࣭໰Λͯ͠
 ճ౴Λ௖͍ͨ • ZennͰهࣄΛॻ্͖͕͛ͨɺެ։લʹΞυόΠεΛͯ͘͠Εͨਓ͚ͩʹ
 ؒҧ͍౳ͳ͍͔ݟͯ΋Β͍͍ͨ • Zennʹ͸ݶఆެ։ͷػೳ͕ͳͦ͞͏ʢ2022/05/03 ຊࢿྉ࡞੒࣌఺ʣ ͖͔͚ͬ

  8. Ͳ͏ʹ͔ͯ͠ݶఆެ։Ͱ͖ͳ͍͔ʁ

  9. ࣗ෼ͷଞʹ΋ݶఆެ։Λߟ͑ͨਓ͕͍Δ͸ͣ

  10. None
  11. https://zenn.dev/e_koma/articles/20210104-zenn-preview

  12. ͜Εͩʂ

  13. ͲΜͳํ๏͔ʁ

  14. લఏɿZennͷCLI͔ΒϓϨϏϡʔΛදࣔ ~/xxxxx/M-Yamashita01/zenn-article ❯ npx zenn preview 👀 Preview: http://localhost:8000

  15. ঺հ͞Ε͍ͯͨݶఆެ։ͷํ๏ Container Registry Cloud Run Push Image Deploy Use Image

    Access Docker fi le ENTRYPOINT ["npx", "zenn", "preview"] https://xxxxx.a.run.app
  16. ΊͬͪΌศརͦ͏ʂ

  17. ͜ͷํ๏Λ࢖ͬͨͱ͖ʹ ՝୊͕͍͔ͭ͘ग़͖ͯͨ

  18. • ෳ਺ͷίϚϯυΛखಈ࣮ߦ͢Δͷ͸ख͕͔͔ؒΔ • ZennͱGitHubΛ࿈ܞࡁΈͳͷͰɺهࣄ࡞੒ͷPull RequestΛτϦΨʔʹ
 ϓϨϏϡʔΛݟ͍ͨ • ϓϨϏϡʔʹ࢖ͬͨCloud RunͷαʔϏε΍ίϯςφΠϝʔδͷফ͠๨ΕΛ
 ආ͚͍ͨ

    ՝୊
  19. ղܾͰ͖ΔΑ ͦ͏ɺGitHub ActionsͳΒͶ

  20. ߏ੒ Container Registry Cloud Run Push article Deploy Access GitHub

    Actions Pull Request Push image Use Image https://xxxxx.a.run.app Post preview url
  21. • Pull RequestͷopenɺpushʹΑΔߋ৽ • طଘͷίϯςφΠϝʔδɺCloud RunͷαʔϏεΛ࡟আ • Container Registry΁ΠϝʔδϓογϡɺCloud RunʹσϓϩΠ

    • σϓϩΠ׬ྃޙʹϓϨϏϡʔͷURLΛPull Requestʹ౤ߘ • Pull Request close • طଘͷίϯςφΠϝʔδɺCloud RunͷαʔϏεΛ࡟আ ϫʔΫϑϩʔ
  22. ಈ࡞݁Ռ (Pull Request open)

  23. ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ