設定基本 CI 流水線

Machine Learning 的 CI/CD

Ravi Bhadauria

Machine Learning Engineer

GitHub Actions 工作流程剖析

# Name of the workflow
name: CI

# Events that trigger workflow on: push: branches: [ "main" ]
Machine Learning 的 CI/CD

GitHub Actions 工作流程剖析

# Define jobs and runners
jobs:
  build:
    runs-on: ubuntu-latest

# Define steps steps: - name: Run a multi-line script run: | echo Hello, world! echo Add other actions to build, echo test, and deploy your project.
Machine Learning 的 CI/CD

GitHub Actions 工作流程剖析

name: CI

on:
  push:
    branches: [ "main" ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Run a multi-line script
        run: |
          echo Hello, world!
          echo Add other actions to build,
          echo test, and deploy your project.
Machine Learning 的 CI/CD

建立 GitHub 儲存庫

在 https://github.com/new 建立新儲存庫的頁面圖片

Machine Learning 的 CI/CD

設定 GitHub Actions

Machine Learning 的 CI/CD

建立「Hello, World!」GitHub Action

在儲存庫首頁突出顯示 Actions 分頁的圖片

Machine Learning 的 CI/CD

建立「Hello, World!」GitHub Action

在儲存庫的 Actions 頁面突出顯示 Configure 分頁的圖片

Machine Learning 的 CI/CD

建立「Hello, World!」GitHub Action

在網頁編輯器中顯示 Hello World Action 與提交變更按鈕的圖片

Machine Learning 的 CI/CD

建立「Hello, World!」GitHub Action

提交變更對話框(輸入提交訊息)的圖片

Machine Learning 的 CI/CD

檢視 GitHub Actions 執行結果

在儲存庫首頁突出顯示動作完成橫幅的圖片

Machine Learning 的 CI/CD

檢視 GitHub Actions 執行結果

顯示成功工作流程的 Actions 頁面圖片

成功工作流程之建置步驟的圖片

Machine Learning 的 CI/CD

檢視記錄

成功工作流程的記錄,顯示各步驟的圖片

Machine Learning 的 CI/CD

一起來練習吧!

Machine Learning 的 CI/CD

Preparing Video For Download...