iitm_scraper / markdown_files /CI_CD__GitHub_Actions.md
Shriyakupp's picture
Upload 107 files
980dc8d verified
metadata
title: 'CI/CD: GitHub Actions'
original_url: https://tds.s-anand.net/#/github-actions?id=cicd-github-actions
downloaded_at: '2025-06-08T23:24:27.252899'

CI/CD: GitHub Actions

GitHub Actions is a powerful automation platform built into GitHub. It helps automate your development workflow - running tests, deploying applications, updating datasets, retraining models, etc.

Here is a sample .github/workflows/iss-location.yml that runs daily, appends the International Space Station location data into iss-location.json, and commits it to the repository.

name: Log ISS Location Data Daily

on:
  schedule:
    # Runs at 12:00 UTC (noon) every day
    - cron: "0 12 * * *"
  workflow_dispatch: # Allows manual triggering

jobs:
  collect-iss-data:
    runs-on: ubuntu-latest
    permissions:
      contents: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install uv
        uses: astral-sh/setup-uv@v5

      - name: Fetch ISS location data
        run: | # python
          uv run --with requests python << 'EOF'
          import requests

          data = requests.get('http://api.open-notify.org/iss-now.json').text
          with open('iss-location.jsonl', 'a') as f:
              f.write(data + '\n')
          'EOF'

      - name: Commit and push changes
        run: | # shell
          git config --local user.email "github-actions[bot]@users.noreply.github.com"
          git config --local user.name "github-actions[bot]"
          git add iss-location.jsonl
          git commit -m "Update ISS position data [skip ci]" || exit 0
          git pushCopy to clipboardErrorCopied

Tools:

Github Actions CI/CD - Everything you need to know to get started

[Previous

Serverless hosting: Vercel](#/vercel)

[Next

Containers: Docker, Podman](#/docker)