กลับไปยังเอกสาร
การผสาน GitHub

CI/CD ด้วย GitHub Actions

ใช้ GitHub Actions เพื่อ build และ deploy แอปพลิเคชันของคุณโดยอัตโนมัติ

Advanced10 min readUpdated 2024-02-01

ทำไมต้องใช้ GitHub Actions?

ข้อดีของการ build ด้วย GitHub Actions:

  • CI minutes ฟรี: GitHub จัดสรร build minutes ฟรี
  • Build เร็วขึ้น: โครงสร้างพื้นฐานของ GitHub มักเร็วขึ้น
  • รักษา server ให้ว่าง: resources VPS ของคุณอยู่สำหรับการรันแอป
  • Workflow ที่คุ้นเคย: ไวยากรณ์ GitHub Actions มาตรฐาน

ตั้งค่า GitHub Actions

  1. Deploy แอปจาก GitHub
  2. ในการตั้งค่า build เลือก "GitHub Actions"
  3. Server Compass สร้างไฟล์ workflow
  4. Commit workflow ไปยัง repo ของคุณ
  5. การ push ในอนาคตจะทริกเกอร์ build อัตโนมัติ

การกำหนดค่า workflow

Workflow ที่สร้างขึ้น:

  • Build Docker image ของคุณ
  • Push ไปยัง GitHub Container Registry
  • แจ้งเตือน Server Compass ให้ deploy
  • ใช้งานได้กับ branch ใดๆ ที่คุณกำหนดค่า

ติดตาม builds

ดูสถานะ build ใน Server Compass:

  1. เปิดแท็บ CI/CD ของแอปของคุณ
  2. ดู workflow runs ล่าสุด
  3. ดู build logs แบบ real-time
  4. ทริกเกอร์ workflows ใหม่ด้วยตนเอง

Screenshots

CI/CD ด้วย GitHub Actions - Screenshot 1
CI/CD ด้วย GitHub Actions - Screenshot 2
CI/CD ด้วย GitHub Actions - Screenshot 3

Video Tutorials

Related Features

Ready to try Server Compass?

Download the app and deploy your first application in under 5 minutes.

Download Server Compass