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
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
Transcript
33 slides
ίʔυͰֶͿ 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)
More Decks by Shinichi Matsumoto
See All by Shinichi Matsumoto
IT勉強会用の名刺ジェネレーターを作った話 / it-benkyoukai-meishi
matt_note
0
210
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
750
From π to Pie charts
rasagy
1
450
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
We Are The Robots
honzajavorek
0
440
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
460
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
990
Raft: Consensus for Rubyists
vanstee
143
7.9k
BBQ
matthewcrist
90
10k
Optimising Largest Contentful Paint
csswizardry
37
4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k