Spaces:
Sleeping
Sleeping
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.
- Understand the basics of YAML configuration files
- Explore the pre-built actions from the marketplace
- How to handle secrets securely
- Triggering a workflow
- Staying within the free tier limits
- Caching dependencies to speed up workflows
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 CLI: Manage workflows from terminal
- Super-Linter: Validate code style
- Release Drafter: Automate releases
- act: Run actions locally
[Previous
Serverless hosting: Vercel](#/vercel)
[Next
Containers: Docker, Podman](#/docker)
