Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GitHub Pages を Web API として使う
Search
Kite
June 11, 2016
Programming
2
3.4k
GitHub Pages を Web API として使う
GitHub の API ではなく、GitHub のサービスの一つである GitHub Pagesを使って、サーバなしで Web API を提供
Kite
June 11, 2016
Tweet
Share
More Decks by Kite
See All by Kite
個人からチームまで、情報・タスク管理の一元化はNotionにお任せ!
ixkaito
13
72k
WordPress でも大丈夫!実例で見るウェブパフォーマンス改善
ixkaito
7
5k
WordPress でも大丈夫!実例で見るウェブパフォーマンス改善
ixkaito
22
7.6k
タイポグラフィベーシック (+ デザインアイデア)
ixkaito
13
3.8k
WordPress の今とこれから
ixkaito
1
1.8k
世界で一人しかできない WordPress コアを写経する話 ― 修行の先に見たものとは?
ixkaito
5
14k
WordPress の今とこれから
ixkaito
4
2.5k
Let's Think about Right Answers of Design and UI/UX
ixkaito
0
360
ブラウザのデフォルトスタイルを見てみよう
ixkaito
3
1.5k
Other Decks in Programming
See All in Programming
Ça bouge du côté des animations CSS !
goetter
2
170
Accelerate your key learnings of scaling modern Android apps
aldefy
0
100
自力でTTSモデルを作った話
zgock999
0
140
iOSでQRコード生成奮闘記
ktcryomm
2
150
SwiftUI移行のためのインプレッショントラッキング基盤の構築
kokihirokawa
0
200
バイセルでの AI を用いた開発の取り組み ~ Devin, Cursor の活用事例・知見共有 ~
umaidashi
0
140
Jasprが凄い話
hyshu
0
210
The Price of Micro Frontends… and Your Alternatives @bastacon 2025 in Frankfurt
manfredsteyer
PRO
0
320
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
250
Jakarta EE meets AI
ivargrimstad
0
970
読もう! Android build ドキュメント
andpad
1
110
React 19アップデートのために必要なこと
uhyo
8
1.6k
Featured
See All Featured
Facilitating Awesome Meetings
lara
53
6.3k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
115
51k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.3k
Adopting Sorbet at Scale
ufuk
75
9.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
11
560
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.4k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
Designing Experiences People Love
moore
140
23k
Transcript
Use GitHub Pages as a Web API GitHub Pages Λ
Web API ͱͯ͠͏ Kansai Front-end users group 2016.06.11 ϑϩϯτΤϯυͷਓ͕Web APIΛޠΔձ
WordPress core contributor Ruby on Rails contributor Wocker developer Bathe
developer Frasco developer Web & graphic designer Programmer Kite KITERETZ inc. CEO & Funder ! kite.koga " ixkaito # ixkaito WHO AM I?
ຊͷςʔϚ GitHub API Ͱͳ͘ɺ Jekyll Pages API Λ͍ GitHub Pages
Ͱ Web API Λ ఏڙ͢Δ͜ͱͰ͋Δɻ
Jekyll Pages API ͱ • Jekyll ͷϓϥάΠϯ • Jekyll αΠτͷͯ͢ͷϖʔδɺߘɺυΩϡϝϯτɺ੩త
ϑΝΠϧͷσʔλΛجʹ JSON ϑΝΠϧΛੜ͢Δ • API http://example.com/api/v1/pages.json ͷΑ͏ͳURL ͰऔಘՄೳ
GitHub Pages Jekyll Λ͏ ϝϦοτ • GitHub Pages Λ͏͜ͱͰɺΠϯϑϥͷϝϯςφϯε͕ෆཁ
• Git ʹΑΔιʔεཧ • API ͷΧελϚΠζ͕ࣗ༝ • ελςΟοΫͳϑΝΠϧͷ৴ͳͷͰɺηΩϡϦςΟϦεΫ͕͍ • ύϒϦοΫϦϙδτϦͰ͔ͭಠࣗυϝΠϯΛ༻͠ͳ͍߹ແ ྉ • ଞͷαʔϏεͷҠߦ༰қ
GitHub Pages GitHub Pages dependencies ʹ͋Δ ϓϥάΠϯҎ֎αϙʔτ͍ͯ͠ͳ͍
ͦͷ·· gh-pages ϒϥϯνͳͲʹϓογϡͯ͠ɺJSON ϑΝ Πϧੜ͞Εͳ͍
ղܾํ๏ • ϩʔΧϧͰੜ͠ɺखಈͰ gh-pages ϒϥϯνͳͲʹϓογϡ ͢Δ • Travis CI ͳͲͷ֎෦αʔϏεΛͬͯࣗಈԽ͢Δ
• Rakefile ͳͲͰσϓϩΠΛ؆୯ʹ͢Δ
खಈσϓϩΠ ϝϦοτ • ֶशίετ͕͍ • ͙͢ʹެ։͞ΕΔ σϝϦοτ • ໘͍͘͞
Travis CI ͳͲʹΑΔσϓϩΠ ϝϦοτ • ௨ৗͷ GitHub Pages/Jekyll ͷӡ༻ͱશ͘ಉ͡ σϝϦοτ
• Travis CI ͳͲͷֶशίετ͕͔͔Δ • GitHub Pages ʹެ։͞ΕΔ·Ͱ͕͔͔࣌ؒΔ
Travis CI ʹΑΔσϓϩΠͷࣄྫ IUUQTHJUIVCDPNDXEJTBTUFSJOGPSNBUJPO
Rakefile ͳͲʹΑΔσϓϩΠ ϝϦοτ • ֎෦αʔϏεʹཔΔඞཁ͕ͳ͘ɺσϓϩΠͷख͔͔ؒΒͳ͍ • GitHub Pages ʹ͙͢ʹެ։͞ΕΔ •
Travis CI ͳͲΑΓֶशίετ͕͍ σϝϦοτ • Rakefile Λ࡞Δඞཁ͕͋Δ • `git push` Ҏ֎ʹɺσϓϩΠ༻ͷίϚϯυΛ࣮ߦ͢Δඞཁ͕͋Δ
Rakefile ͷϘΠϥʔϓϨʔτ IUUQTHJUIVCDPNJYLBJUPKFLZMMBQJCPJMFSQMBUF
͍ํ 1. Jekyll API Boilerplate ΛϑΥʔΫ 2. ϑΥʔΫͨ͠ϦϙδτϦΛΫϩʔϯ 3. Ϋϩʔϯͨ͠σΟϨΫτϦͰԼهΛ࣮ߦ
$ bundle install --path vendor/bundle $ bundle exec jekyll serve --baseurl /jekyll-api-boilerplate 4. http://localhost:4000/jekyll-api-boilerplate/api/v1/ pages.json ʹΞΫηε͢Δ͜ͱͰ JSON API Λ֬ೝͰ͖Δ
GitHub Pages ʹσϓϩΠ 1. `_config.yml` ͷ `url` Λࣗ͝ͷͷʹมߋ 2. σΟϨΫτϦͰԼهΛ࣮ߦ
$ bundle exec rake deploy 3. http://username.github.io/jekyll-api-boilerplate/api/v1/ pages.json ͷΑ͏ͳ URL ʹɺJSON API ͕ެ։͞Ε·͢
Thank You!