GitHub Actions で CI/CD
2021/05/21 あつまれ未来のアーキテクト!Well-Architectedなクラウドを目指して
https://alterbooth.connpass.com/event/211826/
日本マイクロソフト パートナー事業本部
クラウドソリューションアーキテクト 平岡一成
Continuous Integration
Continuous Delivery
(CI / CD)
繰り返し作業を撲滅
GitHub – GitHub Actions
Azure DevOps – Azure Pipelines
Monitor
Plan
Build Test
Release
Deploy
Operate
Code
©Microsoft Corporation
Azure
GitHub Actions (Azure Pipelines でも構造は同じ)
jobs:
build:
name: Hello world action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./action-a
with: MY_NAME: "Mona"
.github/workflows/main.yml
Runner
GitHub ホスト or セルフホスト
Azure
©Microsoft Corporation
Azure
GitHub Actions (Azure Pipelines でも構造は同じ)
jobs:
build:
name: Hello world action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: ./action-a
with: MY_NAME: "Mona"
.github/workflows/main.yml
Runner
Issue, Branch,
Pull Request,
Review, etc
アプリケーションや
インフラのコード
Azure
©Microsoft Corporation
Azure
• 大規模にスケールアウトする
• アプリケーションの数が増える
• アプリケーションの実行基盤が複数パターン
• リージョン冗長をとるために、
まったく同じ構成を N個構成する
• 開発環境、ステージング環境、運用環境、
といった、似て非なる環境をメンテナンスする
• どのリージョンでも共通で使うものを用意する
⇒「あとできれいにする!」は、結果的に損をする
デプロイオペレーションが複雑化していくイメージ
Azure
GitHub Actions
Azure へデプロイするワークフロー
DevOps Starter
DevOps Starter で GitHub Actions のテンプレート作成
DevOps Starter で GitHub Actions のテンプレート作成
©Microsoft Corporation
Azure
©Microsoft Corporation
Azure
<作業プロセス>
• GitHub Codespaces (まだプレビュー)で見てみる
• .devcontainer を活用し、チームで同じ環境を使う
<ワークフローファイル>
• トリガーとなる “on”
• Azure Login
AZURE_CREDENTIALS が登録済み
• デプロイする actions
uses: azure/webapps-deploy@v2
• GitHub 上の編集で、右側ペインに Marketplace
確認すること
まとめ
おすすめ学習コンテンツ
©Microsoft Corporation
Azure
https://www.youtube.com/c/MicrosoftPartnerNetworkJapan/videos
Partner Bootcamp / Technical Briefing
おすすめ学習コンテンツ (1-1) Microsoft Learn
https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/
GitHub Actions: Hello World
おすすめ学習コンテンツ (1-2) Microsoft Learn
https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/
GitHub Actions: Continuous Integration
おすすめ学習コンテンツ (1-3) Microsoft Learn
https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/
GitHub Actions: Continuous Delivery with Azure
おすすめ学習コンテンツ (1-4) Microsoft Learn
https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/
GitHub Actions: Using GitHub Script
おすすめ学習コンテンツ (2) GitHub Learning Lab
https://lab.github.com/githubtraining/github-actions:-continuous-delivery-with-azure
• Azure/actions: Automate your GitHub workflows using Azure Actions
• Azure/login: Connect to Azure
• Azure/docker-login: Enable GitHub developers to deploy to Kubernetes service using GitHub
Actions
• Azure/webapps-container-deploy: Enable GitHub developers to deploy to Azure WebApp for
containers using GitHub Actions
• actions/checkout: Action for checking out a repo
• actions/upload-artifact: Upload artifacts from GitHub's built-in artifact storage.
• actions/download-artifact: Download artifacts from GitHub's built-in artifact storage.
• mattdavis0351/actions/docker-gpr: A GitHub Action to upload Docker images to the GitHub
Package Registry.
©Microsoft Corporation
Azure
SRE (Site Reliability Engineering)
AZ-400:サイト リライアビリティ エンジニアリング (SRE) 戦略の構築 - Learn | Microsoft Docs
© Copyright Microsoft Corporation. All rights reserved.
Thank You !
ありがとうございました!
© 2021 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.
The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should
not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.
MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

GitHub Actions で CI/CD

  • 1.
    GitHub Actions でCI/CD 2021/05/21 あつまれ未来のアーキテクト!Well-Architectedなクラウドを目指して https://alterbooth.connpass.com/event/211826/ 日本マイクロソフト パートナー事業本部 クラウドソリューションアーキテクト 平岡一成
  • 2.
    Continuous Integration Continuous Delivery (CI/ CD) 繰り返し作業を撲滅 GitHub – GitHub Actions Azure DevOps – Azure Pipelines Monitor Plan Build Test Release Deploy Operate Code
  • 3.
    ©Microsoft Corporation Azure GitHub Actions(Azure Pipelines でも構造は同じ) jobs: build: name: Hello world action runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: ./action-a with: MY_NAME: "Mona" .github/workflows/main.yml Runner GitHub ホスト or セルフホスト Azure
  • 4.
    ©Microsoft Corporation Azure GitHub Actions(Azure Pipelines でも構造は同じ) jobs: build: name: Hello world action runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: ./action-a with: MY_NAME: "Mona" .github/workflows/main.yml Runner Issue, Branch, Pull Request, Review, etc アプリケーションや インフラのコード Azure
  • 5.
    ©Microsoft Corporation Azure • 大規模にスケールアウトする •アプリケーションの数が増える • アプリケーションの実行基盤が複数パターン • リージョン冗長をとるために、 まったく同じ構成を N個構成する • 開発環境、ステージング環境、運用環境、 といった、似て非なる環境をメンテナンスする • どのリージョンでも共通で使うものを用意する ⇒「あとできれいにする!」は、結果的に損をする デプロイオペレーションが複雑化していくイメージ Azure
  • 6.
  • 7.
    DevOps Starter でGitHub Actions のテンプレート作成
  • 8.
    DevOps Starter でGitHub Actions のテンプレート作成
  • 9.
  • 10.
    ©Microsoft Corporation Azure <作業プロセス> • GitHubCodespaces (まだプレビュー)で見てみる • .devcontainer を活用し、チームで同じ環境を使う <ワークフローファイル> • トリガーとなる “on” • Azure Login AZURE_CREDENTIALS が登録済み • デプロイする actions uses: azure/webapps-deploy@v2 • GitHub 上の編集で、右側ペインに Marketplace 確認すること
  • 11.
  • 12.
  • 13.
    おすすめ学習コンテンツ (1-1) MicrosoftLearn https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/ GitHub Actions: Hello World
  • 14.
    おすすめ学習コンテンツ (1-2) MicrosoftLearn https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/ GitHub Actions: Continuous Integration
  • 15.
    おすすめ学習コンテンツ (1-3) MicrosoftLearn https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/ GitHub Actions: Continuous Delivery with Azure
  • 16.
    おすすめ学習コンテンツ (1-4) MicrosoftLearn https://docs.microsoft.com/ja-jp/learn/paths/automate-workflow-github-actions/ GitHub Actions: Using GitHub Script
  • 17.
    おすすめ学習コンテンツ (2) GitHubLearning Lab https://lab.github.com/githubtraining/github-actions:-continuous-delivery-with-azure • Azure/actions: Automate your GitHub workflows using Azure Actions • Azure/login: Connect to Azure • Azure/docker-login: Enable GitHub developers to deploy to Kubernetes service using GitHub Actions • Azure/webapps-container-deploy: Enable GitHub developers to deploy to Azure WebApp for containers using GitHub Actions • actions/checkout: Action for checking out a repo • actions/upload-artifact: Upload artifacts from GitHub's built-in artifact storage. • actions/download-artifact: Download artifacts from GitHub's built-in artifact storage. • mattdavis0351/actions/docker-gpr: A GitHub Action to upload Docker images to the GitHub Package Registry.
  • 18.
    ©Microsoft Corporation Azure SRE (SiteReliability Engineering) AZ-400:サイト リライアビリティ エンジニアリング (SRE) 戦略の構築 - Learn | Microsoft Docs
  • 19.
    © Copyright MicrosoftCorporation. All rights reserved. Thank You ! ありがとうございました! © 2021 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.