Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
コードで学ぶGitHub Actions(beta) / learn github actio...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shinichi Matsumoto
October 17, 2019
95
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
コードで学ぶGitHub Actions(beta) / learn github actions beta with code
Shinichi Matsumoto
October 17, 2019
More Decks by Shinichi Matsumoto
See All by Shinichi Matsumoto
IT勉強会用の名刺ジェネレーターを作った話 / it-benkyoukai-meishi
matt_note
0
200
Featured
See All Featured
For a Future-Friendly Web
brad_frost
184
10k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
600
Un-Boring Meetings
codingconduct
0
450
Faster Mobile Websites
deanohume
310
32k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
560
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
350
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Optimizing for Happiness
mojombo
378
71k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Transcript
ίʔυͰֶͿ GitHub Actions (beta) 2019-10-17 ฏ.rb #9 দຊ ਅҰ (@matt59649858)
ࣗݾհ • দຊਅҰ • GitHub: matt-note • Twitter: @matt59649858 •
໌ɺ౦ژʹҾͬӽ͢༧ఆɻ ITษڧձ༻ͷ ໊δΣωϨʔλʔΛ ࡞Γ·ͨ͠ɻ →
ࠓ͓͢͠Δ͜ͱ 1. GitHub Actionsͷ֓ཁ 2. RubyϦϙδτϦͰGitHub ActionsΛֶͿ
1. GitHub Actionsͷ֓ཁ
GitHub Actionsͱ • GitHubͷCI/CDػೳʢޙड़͠·͢ʣɻ • 201911݄13ʹਖ਼ࣜ൛ΛϦϦʔεʢถࠃ࣌ؒʣɻ • publicϦϙδτϦશແྉɻ • 1ϦϙδτϦͨΓ20ฒྻ·ͰδϣϒΛ࣮ߦͰ͖Δɻ
CI (ܧଓతΠϯςάϨʔγϣϯ)ͱ • ։ൃऀ͕ίʔυΛมߋɾίϛοτͯ͠ϦϙδτϦʹ ϓογϡͨ࣌͠ʹɺࣗಈԽͨ͠ϏϧυͱςετΛ࣮ߦ ͢ΔιϑτΣΞ։ൃख๏ɻ → GitHubͰ݁͢Δ Α͏ʹͳͬͨɻ
CD (ܧଓతσϦόϦʔ)ͱ • ܧଓతΠϯςάϨʔγϣϯ(CI)Λ֦ுͨ͠ख๏Ͱɺ Ϗϧυςετ͚ͩͰͳ͘ɺϦϦʔεϓϩηεશମΛ ࣗಈԽ͢Δɻ
ฒྻͱ • ಉ࣌ʹෳͷδϣϒΛ࣮ߦ͢Δɻ • ॲཧ͕࣌ؒ͘ͳΔɻ
20ฒྻɺຊʹͯ͘͢͝ɺ શ෦ԣʹฒΕ ͙͢ऴΘΔͱ͍͏ঢ়ଶ —— @hsbt
2. RubyϦϙδτϦͰ GitHub ActionsΛֶͿ
RubyϦϙδτϦ • ruby/rubyϦϙδτϦͰɹɹɹɹɹɹɹɹɹɹɹ GitHub Actions͕ಋೖ͞Ε͍ͯΔɻ
.github/workflows • .github/workflows σΟϨΫτϦʹɹɹɹɹɹɹɹɹ ϫʔΫϑϩʔΛهड़ͨ͠YAMLϑΝΠϧΛ࡞ɾίϛο τͯ͠ϓογϡ͢Δ͚ͩͰGitHub Actions͕ಈ࡞͢Δɻ
ϫʔΫϑϩʔͱ • ࣗಈԽͨ͠ॲཧͷ͜ͱɻ • ϏϧυςετͳͲΛߦ͏ɻ
ubuntu.yml (8ߦ·Ͱ) • name • on
name • ϫʔΫϑϩʔͷ໊લΛઃఆ͢Δɻ
on • Ͳ͏͍͏࣌ʹϫʔΫϑϩʔΛ࣮ߦ͢Δ͔ઃఆ͢Δɻ
on matzbotʹΑͬͯmasterϒϥϯν͕ push͞ΕͨͷͰɺϫʔΫϑϩʔΛ࣮ߦɻ XrXr͞Μ͔Βpull_request͕͋ͬͨͷͰ ϫʔΫϑϩʔΛ࣮ߦɻ ↓ ↓
ubuntu.yml (20ߦ·Ͱ) • ͋ͱjobsΛઃఆ͢Δ͚ͩɻ →
jobs • ࣗಈԽ͍ͨ͠δϣϒΛ·ͱΊͯઃఆ͢Δɻ
jobs.<job_id> • jobsͷԼͷ֊Ͱɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹ ֤δϣϒͷIDΛจࣈྻܕͰઃఆ͢Δɻ ←δϣϒͷ࣮ߦ݁Ռ ɹjob_idͰදࣔ͞ΕΔɻ ← job_idlatest
jobs.<job_id>.runs-on • δϣϒΛ࣮ߦ͢ΔԾڥͷछྨΛઃఆ͢Δɻ ↑ ubuntu-latestڥͰδϣϒΛ࣮ߦ͢Δɻ
jobs.<job_id>.steps • ࣗಈԽ͍ͨ͠ॲཧΛॱ൪ʹઃఆ͍ͯ͘͠ɻ
jobs.<job_id>.steps.run • ԾڥͷγΣϧͰ࣮ߦ͢ΔॲཧΛઃఆ͢Δɻ →
jobs.<job_id>.steps.name • εςοϓͰදࣔ͢Δ໊લΛઃఆ͢Δɻ →
jobs.<job_id>.steps.env • ԾڥͰεςοϓ͕͏ڥมΛઃఆͰ͖Δɻ →
${{ toJson() }} • ${{ }} ͰಈతʹΛઃఆ͢Δɻ • toJsonGitHub ActionsʹΈࠐ·Ε͍ͯΔσόοά༻
ͷؔɻίϯςΩετͷใΛσόοά͢ΔͨΊʹ ͏ɻ
githubίϯςΩετσʔλ • ϫʔΫϑϩʔ࣮ߦ࣌ͷใίϯςΩετʹอ࣋͞Ε ΔɻgithubίϯςΩετσʔλڥมͰಡΈऔΔ ͜ͱ͕Ͱ͖Δɻ
job.<job_id>.steps.if • ಛఆͷ݅Λຬͨ͢ͱ͖͚ͩεςοϓΛ࣮ߦ͢ΔΑ͏ʹ ઃఆͰ͖Δɻ push͕͋ͬͯδϣϒͷ࣮ߦʹࣦഊͨ࣌͠ʹ͚ͩ githubίϯςΩετσʔλΛදࣔͯ͠σόοά͢Δɻ ↓
jobs.<job_id>.steps.uses • δϣϒͰεςοϓͷҰ෦ͱ࣮ͯ͠ߦ͞ΕΔΞΫγϣϯΛ ઃఆ͢Δɻ ↓ GitHubͷpublicϦϙδτϦΛࢦఆͯ͠ɺ ఆٛ͞Ε͍ͯΔΞΫγϣϯΛ࣮ߦ͢Δɻ
Jobs.<job_id>.steps.with • ΞΫγϣϯʹ͢ೖྗΛઃఆ͢Δɻ ↓ slackʹ௨͢ΔΞΫγϣϯΛ࣮ߦ͢Δ࣌ʹɺ payloadͷΛ͢ɻ
͓·͚ RailsΞϓϦͰGitHub ActionsΛ ͬͨྫ https://github.com/matt-note/it-benkyoukai-meishi-generator/blob/master/.github/ workflows/rails-ci.yml https://github.com/matt-note/it-benkyoukai-meishi-generator/actions
͝੩ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ
ࢀߟURL • https://github.blog/2019-08-01-why-you-need-to-be-at-github-universe-2019/ • ιϑτ։ൃʹ͓͢͢ΊͷCI(ܧଓతΠϯςάϨʔγϣϯ)πʔϧͱʢhttps://persol-tech-s.co.jp/ hatalabo/it_engineer/309.htmlʣ • CD(ܧଓతσϦόϦʔ)ͱʢhttps://cloudbees.techmatrix.jp/devops/cd/ʣ • ฒߦॲཧɺฒྻॲཧͷ͋Ε͜Εʢhttps://qiita.com/Kohei909Otsuka/items/
26be74de803d195b37bdʣ • GitHub Actions ͕ϩʔϯν͞ΕͨͷͰϚΠάϨʔτͯ͠Δ ʢhttps://www.hsbt.org/diary/ 20190811.htmlʣ • RubyϦϙδτϦ ʢhttps://github.com/ruby/rubyʣ • ৽ GitHub Actions ೖ (https://www.kaizenprogrammer.com/entry/2019/08/18/205010) • GitHub ActionsͷϫʔΫϑϩʔߏจ (https://help.github.com/ja/articles/workflow-syntax-for-github- actions) • GitHub Actions ͷίϯςΩετ͓Αͼࣜͷߏจ (https://help.github.com/ja/articles/contexts-and- expression-syntax-for-github-actions)