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 の Tips
Search
kimizuy
November 17, 2022
Programming
290
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
最近知った GitHub Actions の Tips
2022/11/16に開催された第2回 LT 練習会(仮)の発表資料です。
https://gaji-lt.connpass.com/event/263763/
kimizuy
November 17, 2022
More Decks by kimizuy
See All by kimizuy
実践Server Actions
kimizuy
0
38
Exploring Hono
kimizuy
0
64
ざっくり知る tamagui v1
kimizuy
0
260
個人ブログをNext13のApp Directoryに移行しました
kimizuy
0
330
5分で予習する Next.js 「Layouts RFC」
kimizuy
0
790
Other Decks in Programming
See All in Programming
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
140
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
360
Everything will be SERVERLESS — 信じて運用した10年の経験値 / Everything Will be Serverless — Lessons Learned from 10 Years of Operational Experience
seike460
PRO
1
940
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
220
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
130
気持ちぃ〜角丸 Squircle
ryu1013
0
170
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
100
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
22
22k
Jetpack Compose Mechanisms
skydoves
2
670
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
350
contenteditable と日本語入力に向き合う
colorful12
0
180
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
180
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
580
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Git: the NoSQL Database
bkeepers
PRO
433
67k
Claude Code のすすめ
schroneko
67
230k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Everyday Curiosity
cassininazir
0
350
The Curious Case for Waylosing
cassininazir
1
560
From π to Pie charts
rasagy
1
390
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
400
Transcript
最近知った GitHub Actions の Tips 2022/11/16 第2回LT練習会(仮)発表資料 最近知った GitHub Actions
の Tips @kimizuy
自己紹介 ID: @kimizuy 株式会社 Gaji-Labo フロントエンドエンジニア 最近は React や TypeScript
をメインで使っています。 趣味はスプラトゥーン 3 です。 https://github.com/kimizuy https://twitter.com/kimizuy 最近知った GitHub Actions の Tips @kimizuy
最近知った GitHub Actions の便利機能をいくつか紹介します! 最近知った GitHub Actions の Tips @kimizuy
そもそも GitHub Actions とは ソフトウェアのワークフローを自動化できる CI/CD。GitHub から直接、コードのビル ド、テスト、デプロイができる プルリクエスト作成のタイミングでテストを実行したりマージをきっかけに再デプロイ を実行したりといったワークフローを
GitHub のプラットホーム上で一貫して行うこと ができる 最近知った GitHub Actions の Tips @kimizuy
基本形: push したらワークフローを実行する branches :main ブランチへの push paths : 指定したパスのファイル変更のみで実行する
on: push: branches: - main paths: - 'src/**' 最近知った GitHub Actions の Tips @kimizuy
ワークフローを手動実行できるように する on: workflow_dispatch: 参考: Manually running a workflow https://docs.github.com/en/actions/managing-
workflow-runs/manually-running-a-workflow 最近知った GitHub Actions の Tips @kimizuy
ワークフローから同じリポジトリにあるほかのワークフローを呼びだす 呼び出す側: # deploy.yml jobs: call-foo-workflow: needs: deploy uses: kimizuy/awesome-repo/.github/workflows/generate-sitemap.yml@main
呼び出される側: # generate-sitemap.yml on: workflow_call: 最近知った GitHub Actions の Tips @kimizuy
参考: on.workflow_call https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/workflow- syntax-for-github-actions#onworkflow_call 注意点として、 workflow_call は同一のリポジトリの呼び出しのみ対応している。 Both workflows are
in the same repository. Access to reusable workflows 最近知った GitHub Actions の Tips @kimizuy
ワークフローから別のリポジトリにあるほかのワークフローを呼びだす GitHub API を使って repository_dispatch という Webhook イベントを作成することで 別のリポジトリのワークフローに通知、起動できる。 以下では、peter-evans/repository-dispatch@v2
というプラグインを使っている。 通知側: jobs: steps: - name: Dispatch update-foo uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.REPOSITORY_DISPATCH_TOKEN }} repository: 'kimizuy/awesome-another-repo' event-type: update-foo ↓ 最近知った GitHub Actions の Tips @kimizuy
通知される側: on: repository_dispatch: types: [update-foo] update-foo というイベントを受け取ってワークフローが実行される。 参考: repository_dispatch https://docs.github.com/en/actions/using-workflows/events-that-trigger-
workflows#repository_dispatch 最近知った GitHub Actions の Tips @kimizuy
重複したワークフローの実行を中断する 同じワークフローが複数実行中のとき、最後のワークフローのみを実行し以前のワークフロ ーはキャンセルする。 デフォルトはキャンセルされないので cancel-in-progress: true を指定する。 on: concurrency: group:
${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true 参考: GitHub Actions で連続 push した時に止めるアレ https://zenn.dev/katzumi/articles/using-concurrency-at-github-actions 最近知った GitHub Actions の Tips @kimizuy
まとめ 基本形: push したらワークフローを実行する ワークフローを手動実行できるようにする ワークフローから同じリポジトリにあるほかのワークフローを呼びだす ワークフローから別のリポジトリにあるほかのワークフローを呼びだす 重複したワークフローの実行を中断する 最近知った GitHub
Actions の Tips @kimizuy
以上、ご静聴いただきありがとうございました。 最近知った GitHub Actions の Tips @kimizuy
最近知った GitHub Actions の Tips @kimizuy