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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
37
Exploring Hono
kimizuy
0
60
ざっくり知る tamagui v1
kimizuy
0
250
個人ブログをNext13のApp Directoryに移行しました
kimizuy
0
310
5分で予習する Next.js 「Layouts RFC」
kimizuy
0
770
Other Decks in Programming
See All in Programming
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.4k
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
3
380
AIエージェント時代のコードレビューを設計する
nogu66
6
2.6k
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
580
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
不幸な GC
chencmd
0
890
Snowflakeで業務アプリを作ろう。 Snowflakeのアプリ機能解説&実践ガイド
ayumu_yamaguchi
1
190
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
5
1.3k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
120
世界の中心で、AI(App Intents)をさけぶ ー App Intents中心設計の実践ガイド
touyou
0
190
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
190
XHTMLが残したもの
yosuke_furukawa
PRO
2
470
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
ラッコキーワード サービス紹介資料
rakko
1
4.8M
Practical Orchestrator
shlominoach
191
12k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
410
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
320
The SEO identity crisis: Don't let AI make you average
varn
0
550
Evolving SEO for Evolving Search Engines
ryanjones
0
280
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Building the Perfect Custom Keyboard
takai
2
870
Facilitating Awesome Meetings
lara
57
7.1k
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