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
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
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
270
XHTMLが残したもの
yosuke_furukawa
PRO
2
640
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
140
Press start. Python's next generation.
willingc
PRO
3
330
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
2.7k
業務時間外もAIに働いてもらう話
colorful12
3
10k
【DroidKaigi 2026】「アクセシビリティを利用するとき、 アクセシビリティもまたこちらを利用している」 〜マルウェアによる攻撃と防衛について〜
halunoyo
0
440
高専キャリア LT 発表内容
crysta1221
6
5.6k
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
520
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
120
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
1.1k
Featured
See All Featured
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Color Theory Basics | Prateek | Gurzu
gurzu
0
460
Typedesign – Prime Four
hannesfritz
42
3.2k
Being A Developer After 40
akosma
91
590k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
270
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Balancing Empowerment & Direction
lara
6
1.3k
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