Complete Guide to Upptime: Uptime Monitoring with GitHub Actions

Uncategorized

Upptime is a free and open-source uptime monitoring solution powered by GitHub Actions, Issues, and Pages. It allows you to monitor websites and services with zero infrastructure setup and host status pages using GitHub Pages.


πŸš€ What is Upptime?

  • Open-source uptime monitor using GitHub Actions
  • Stores downtime as GitHub Issues
  • Publishes status pages via GitHub Pages
  • Inspired by UptimeRobot, StatusPage.io, etc.

🀝 Key Features

  • Website uptime monitoring
  • SSL certificate expiry tracking
  • Response time metrics and graphs
  • GitHub-powered automation (no external services required)
  • Free hosting via GitHub Pages

πŸ”§ Prerequisites

  • GitHub account
  • Basic knowledge of Git and GitHub
  • Node.js (for local testing, optional)

🌐 Getting Started with Upptime

Step 1: Create a New Public GitHub Repository

Name it something like yourproject-status.

Step 2: Use the Upptime Template

  1. Go to https://github.com/upptime/upptime
  2. Click Use this template
  3. Choose your new repo name and create it

Step 3: Configure .upptimerc.yml

Add your domains/services to monitor:

owner: your-github-username
repo: yourproject-status
sites:
  - name: Homepage
    url: https://example.com
  - name: Blog
    url: https://blog.example.com

Step 4: Set Up GitHub Secret for PAT

  1. Generate a GitHub Personal Access Token (PAT) with repo and workflow permissions.
  2. Go to your repo > Settings > Secrets and Variables > Actions
  3. Add a secret:
    • Name: GH_PAT
    • Value: paste your token here

Step 5: First Commit and Deploy

Upptime will:

  • Monitor websites every 5 minutes (via GitHub Actions)
  • Log incidents as GitHub issues
  • Build status page at https://yourusername.github.io/yourproject-status

πŸ“Š GitHub Actions Workflows in Upptime

update.yml

  • Runs every 5 minutes
  • Checks all configured sites
  • Logs downtime as issues

graphs.yml

  • Updates response time and availability graphs daily

site.yml

  • Builds static status site using Jekyll and pushes to gh-pages branch

πŸ› οΈ Customize Your Upptime Setup

Customize .upptimerc.yml

  • sites for defining your monitored URLs
  • status-website: to toggle GitHub Pages deployment
  • commit-message: customize auto-commit messages

Enable SSL Monitoring

Enabled by default. It warns before SSL certs expire.


πŸ“Š Visualize Data

  • Response time graphs (daily/hourly)
  • Uptime percentage trends
  • Public status page with badges and history

πŸ”„ Example: Monitor 3 Websites

owner: devteam
repo: devteam-status
sites:
  - name: Main Site
    url: https://example.com
  - name: API
    url: https://api.example.com
  - name: Docs
    url: https://docs.example.com

πŸ”§ Advanced Features

  • Incidents: Logged automatically as GitHub Issues
  • Custom Headers: Add auth tokens or custom user agents
  • Status Page Themes: Customize with CSS/Jekyll

πŸŽ“ Learning Resources


πŸš€ Why Use Upptime?

FeatureBenefit
Free ForeverHosted on GitHub
Easy SetupJust a YAML file and token
GitHub NativeLeverages Actions, Issues, Pages
TransparentDowntime is visible via issues

πŸ™Œ Final Tips

  • Keep your PAT secret safe
  • Use different repos for different projects
  • Customize the status page for your brand
  • Combine with Slack/Email alerts via GitHub Issue actions

πŸŽ‰ You’re All Set!

Upptime is an excellent solution for teams or individuals wanting robust uptime monitoring without external dependencies or costs. Set it up in minutes and get peace of mind!

Example Code

Here is a complete GitHub Actions workflow using Upptime to monitor uptime and SSL certificate expiry for the following domains:

  • motoshare.us
  • motoshare.mx
  • motoshare.ca
  • motoshare.in
  • motoshare.co
  • motoshare.com.cn
  • motoshare.id
  • motoshare.jp

βœ… Step-by-step Setup

  1. Create a public GitHub repo (e.g., motoshare-status).
  2. Install Upptime: Follow instructions at https://upptime.js.org.
  3. Add the following configuration to the .upptimerc.yml file.
  4. GitHub Actions will automatically run every 5 minutes.

πŸ› οΈ .upptimerc.yml (Place in root)

owner: your-github-username
repo: motoshare-status
sites:
  - name: motoshare.us
    url: https://motoshare.us
  - name: motoshare.mx
    url: https://motoshare.mx
  - name: motoshare.ca
    url: https://motoshare.ca
  - name: motoshare.in
    url: https://motoshare.in
  - name: motoshare.co
    url: https://motoshare.co
  - name: motoshare.com.cn
    url: https://motoshare.com.cn
  - name: motoshare.id
    url: https://motoshare.id
  - name: motoshare.jp
    url: https://motoshare.jp

πŸ§ͺ GitHub Actions Workflow File

Create the following workflow file:

.github/workflows/uptime.yml

name: Uptime CI

on:
  schedule:
    - cron: '*/5 * * * *' # every 5 minutes
  workflow_dispatch:

jobs:
  update:
    name: Update summary and graphs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Install dependencies
        run: npm install
      - name: Update site statuses
        run: npx upptime update
        env:
          GH_PAT: ${{ secrets.GH_PAT }}

βœ… Additional Setup

  1. Generate a Personal Access Token from GitHub (with repo and workflow scope).
  2. Go to your repo β†’ Settings β†’ Secrets and variables β†’ Actions.
  3. Add secret:
    • Name: GH_PAT
    • Value: Your personal access token

βœ… Deploy

Commit and push to your GitHub repo. Upptime will start monitoring the 8 domains and generate markdown-based status reports under /status.


Leave a Reply

Your email address will not be published. Required fields are marked *