Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
最近知った GitHub Actions の Tips
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
kimizuy
November 17, 2022
Programming
0
260
最近知った GitHub Actions の Tips
2022/11/16に開催された第2回 LT 練習会(仮)の発表資料です。
https://gaji-lt.connpass.com/event/263763/
kimizuy
November 17, 2022
Tweet
Share
More Decks by kimizuy
See All by kimizuy
実践Server Actions
kimizuy
0
31
Exploring Hono
kimizuy
0
49
ざっくり知る tamagui v1
kimizuy
0
230
個人ブログをNext13のApp Directoryに移行しました
kimizuy
0
300
5分で予習する Next.js 「Layouts RFC」
kimizuy
0
720
Other Decks in Programming
See All in Programming
20260315 AWSなんもわからん🥲
chiilog
2
170
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
140
Understanding Apache Lucene - More than just full-text search
spinscale
0
140
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
290
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
160
SourceGeneratorのマーカー属性問題について
htkym
0
210
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
160
20260320登壇資料
pharct
0
120
KagglerがMixSeekを触ってみた
morim
0
260
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
330
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
150
今年もTECHSCOREブログを書き続けます!
hiraoku101
0
120
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
860
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Paper Plane (Part 1)
katiecoart
PRO
0
5.8k
Prompt Engineering for Job Search
mfonobong
0
220
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
280
Information Architects: The Missing Link in Design Systems
soysaucechin
0
840
The Language of Interfaces
destraynor
162
26k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
300
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
エンジニアに許された特別な時間の終わり
watany
106
240k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
450
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