メインコンテンツにスキップ

google-apps-script-cd-web-app-demo

Demo: Build a lightweight, serverless CD dashboard with Google Apps Script that connects GitHub Actions and Firebase App Distribution, providing a simple web UI to view build statuses and download test apps—fast to deploy, easy to extend, and requiring no additional infrastructure.

AI Summary

GAS CD Dashboard Demo

A demo Google Apps Script that builds a serverless web dashboard to visualise GitHub Actions build status and distribute test apps via Firebase App Distribution.

Target Users

Intermediate GAS or frontend developers who need a no-infrastructure way to check mobile build status and distribute test apps through CI/CD.

Problems Solved

Viewing CI/CD build results and distributing test apps usually requires dedicated servers or dashboards that add setup and maintenance overhead.

Tags

Main Features

1
Serverless Visualisation

Fetches and renders GitHub Actions workflow results using only GAS and HTML Service, eliminating extra infrastructure.

2
Firebase App Distribution Integration

Calls Firebase App Distribution API to expose download links, unifying build and distribution in one place.

3
Fast Deployment

Deployable directly from the Apps Script editor, drastically reducing environment-setup time.

Usage Examples

Display latest GitHub Actions builds

The snippet below fetches the last five workflow runs from GitHub and renders them as a simple HTML list.

/**
 * Return latest GitHub Actions workflow runs as HTML.
 */
function doGet() {
  const owner = 'your-org';   // GitHub owner
  const repo  = 'your-repo';  // Repository name
  const token = 'ghp_xxx';    // Personal Access Token

  // Fetch latest 5 runs
  const url = `https://api.github.com/repos/${owner}/${repo}/actions/runs?per_page=5`;
  const response = UrlFetchApp.fetch(url, {
    headers: { Authorization: `token ${token}` }
  });

  const runs = JSON.parse(response.getContentText()).workflow_runs;

  // Build HTML output
  let html = '<h1>Latest Builds</h1><ul>';
  runs.forEach(run => {
    html += `<li>${run.name} #${run.run_number} : ${run.conclusion}</li>`;
  });
  html += '</ul>';

  return HtmlService.createHtmlOutput(html);
}

Copy this into an Apps Script project, deploy as a web app, and open the /exec URL to see your latest build results.