Simple GitHub Actions Workflow - Github-actions Typing CST Test
Loading…
Simple GitHub Actions Workflow — Github-actions Code
A simple GitHub Actions workflow to build and test a Node.js application.
# .github/workflows/demo.yml
name: Node.js CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: npm install
- name: Run tests
run: npm testGithub-actions Language Guide
GitHub Actions is a CI/CD and automation platform integrated with GitHub that allows developers to automate workflows for building, testing, and deploying code directly from their repositories using YAML configuration files.
Primary Use Cases
- ▸Continuous integration (build, test, lint)
- ▸Continuous deployment to cloud or on-prem servers
- ▸Automating code review tasks
- ▸Scheduled maintenance tasks or cron jobs
- ▸Workflow orchestration across multiple repositories
Notable Features
- ▸YAML-based workflow definitions
- ▸Triggers on multiple GitHub events
- ▸Matrix builds for parallel testing
- ▸Marketplace with reusable actions
- ▸Integration with self-hosted or GitHub-hosted runners
Origin & Creator
Developed by GitHub to provide integrated CI/CD and automation within GitHub repositories, eliminating the need for external CI/CD services.
Industrial Note
GitHub Actions is widely used in open-source projects, DevOps automation, continuous deployment to cloud providers, and integration with microservices architectures.