Slide 1

Slide 1 text

Lighthouse CI Λ࢖ͬͯ ܧଓతʹείΞΛܭଌ͠Α͏ʂ 2020/11/12(໦) ίωώτϚϧγΣΦϯϥΠϯ

Slide 2

Slide 2 text

ࣗݾ঺հ • ΋Γ΍ ͻΖΏ͖ • 2019/09 ίωώτೖࣾ • ϑϩϯτΤϯυΤϯδχΞ • ॳLT

Slide 3

Slide 3 text

Lighthouse ࢖ͬͯ·͔͢ʁ

Slide 4

Slide 4 text

Lighthouse: Webϖʔδͷ؂ࠪπʔϧ • ύϑΥʔϚϯε • PWA • ΞΫηγϏϦςΟ • ϕετϓϥΫςΟε • SEO

Slide 5

Slide 5 text

Lighthouse Ͱܧଓతʹ είΞΛܭଌͯ͠·͔͢ʁ

Slide 6

Slide 6 text

Webϖʔδ͸࡞ͬͯऴΘΓͰ͸ͳ͍ • ӡ༻͞Ε͍ͯΔWebϖʔδͰ͋Ε͹৭ʑͳมߋ͕ೖΔ • ܧଓతʹܭଌ͠ͳ͍ͱɺείΞ͕མͪͯ΋ؾ͚ͮͳ͍

Slide 7

Slide 7 text

ܧଓతʹείΞΛܭଌ͍ͨ͠ ͚Ͳ໘౗ɾɾɾ

Slide 8

Slide 8 text

ͦΜͳ࣌͸ɺ Lighthouse CI Λ ࢖͍·͠ΐ͏ʂ

Slide 9

Slide 9 text

Lighthouse CI: CI Ͱ Lighthouse Λ࣮ߦ

Slide 10

Slide 10 text

Lighthouse CI ͷಋೖ

Slide 11

Slide 11 text

ઃఆϑΝΠϧΛ௥Ճͯ͠ɺ module.exports = { ci: { collect: { staticDistDir: "./", }, upload: { target: "temporary-public-storage", }, }, };

Slide 12

Slide 12 text

̍εςοϓ௥Ճ͢Δ͚ͩʂ ʢGitHub Actions ͷྫʣ name: "lighthouse" on: ["push"] jobs: lhci: name: Lighthouse runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 - name: run Lighthouse CI run: | npm install -g @lhci/[email protected] lhci autorun

Slide 13

Slide 13 text

࣮ߦ

Slide 14

Slide 14 text

ϩάʹ݁ՌURL͕ग़ྗ͞Εɺ

Slide 15

Slide 15 text

݁Ռ͕ݟΕ·ͨ͠ʂ

Slide 16

Slide 16 text

͔֬ʹܧଓతʹܭଌͰ͖Δ͚Ͳ ͜Ε͡Όݟͳ͍ΑͶɾɾɾɻ

Slide 17

Slide 17 text

ͦΜͳ࣌͸ɺ Lighthouse CI Server Λ ࢖͍·͠ΐ͏ʂ

Slide 18

Slide 18 text

Lighthouse CI Server: είΞͷ஝ੵ

Slide 19

Slide 19 text

Lighthouse CI Server ͷಋೖ

Slide 20

Slide 20 text

̏෼Ͱ Heroku ʹσϓϩΠ # ϑΝΠϧͷηοτΞοϓ $ mkdir lhci-heroku && cd lhci-heroku && git init $ curl https://raw.githubusercontent.com/GoogleChrome/lighthouse- ci/master/docs/recipes/heroku-server/package.json > package.json $ curl https://raw.githubusercontent.com/GoogleChrome/lighthouse- ci/master/docs/recipes/heroku-server/server.js > server.js $ git add -A && git commit -m 'Initial commit' # Heroku ΁ͷσϓϩΠ $ heroku create $ heroku addons:create heroku-postgresql:hobby-dev $ git push heroku master $ heroku ps:scale web=1 $ heroku open

Slide 21

Slide 21 text

Ξοϓϩʔυͷઃఆ

Slide 22

Slide 22 text

΢Οβʔυͷ࣮ߦ $ lhci wizard ? Which wizard do you want to run? new-project ? What is the URL of your LHCI server? https:// lighthouse-hyiromori.herokuapp.com/ ? What would you like to name the project? test ? Where is the project's code hosted? https:// github.com/hyiromori/test ? What branch is considered the repo's trunk or main branch? main

Slide 23

Slide 23 text

ઃఆϑΝΠϧͷมߋ module.exports = { ci: { collect: { staticDistDir: "./", }, upload: { - target: "temporary-public-storage", + target: "lhci", + serverBaseUrl: "https://xxxxxxxxx.herokuapp.com", + token: "(΢ΟβʔυͰग़ͨϏϧυτʔΫϯ)", }, }, };

Slide 24

Slide 24 text

࠶࣮ߦ

Slide 25

Slide 25 text

είΞ͕௥Ճ͞Εͨʂ

Slide 26

Slide 26 text

είΞ͕૿͑ͨਤ

Slide 27

Slide 27 text

είΞͷDiff

Slide 28

Slide 28 text

·ͱΊ

Slide 29

Slide 29 text

Lighthouse: Webϖʔδͷ؂ࠪπʔϧ ʢ࠶ܝʣ • ύϑΥʔϚϯε • PWA • ΞΫηγϏϦςΟ • ϕετϓϥΫςΟε • SEO

Slide 30

Slide 30 text

Lighthouse CI: CI Ͱ Lighthouse Λ࣮ߦ ʢ࠶ܝʣ

Slide 31

Slide 31 text

Lighthouse CI Server: είΞͷ஝ੵ ʢ࠶ܝʣ

Slide 32

Slide 32 text

ಋೖίετ͸͔ͳΓ௿͍ͷͰɺ ؾʹͳͬͨΒؾָʹಋೖͯ͠Έ ·͠ΐ͏ʂ

Slide 33

Slide 33 text

ৄ͍͠ղઆΛݟ͍ͨํ΁ Lighthouse CI ͱ Heroku Ͱ΢ΣϒϖʔδͷείΞΛܧଓతʹଌఆͯ͠ਪ ҠΛݟΔ https://hyiromori.hateblo.jp/entry/2020/11/02/LHCI

Slide 34

Slide 34 text

͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ