GitHub Actions is a feature of GitHub that lets you create automated workflows for your software projects—right inside your GitHub repository.
You can build CI/CD pipelines (Continuous Integration / Continuous Deployment), such as:
🛠️ Build your app on every push or pull request
🚀 Automatically deploy (e.g. to a server, cloud platform, or DockerHub)
📦 Create releases (e.g. zip packages or version tags)
🔄 Run scheduled tasks (cronjobs)
GitHub Actions uses workflows, defined in a YAML file inside your repository:
Typically stored as .github/workflows/ci.yml
You define events (like push
, pull_request
) and jobs (like build
, test
)
Each job consists of steps, which are shell commands or prebuilt actions
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
- run: npm install
- run: npm test
An Action is a single reusable step in a workflow. You can use:
Prebuilt actions (e.g. actions/checkout
, setup-node
, upload-artifact
)
Custom actions (e.g. shell scripts or Docker-based logic)
You can explore reusable actions in the GitHub Marketplace.
Saves time by automating repetitive tasks
Improves code quality through automated testing
Enables consistent, repeatable deployments
Integrated directly in GitHub—no need for external CI tools like Jenkins or Travis CI
Jest is a JavaScript testing framework developed by Meta (Facebook). It is mainly used for testing JavaScript and TypeScript applications, especially React applications, but it also works well for Node.js backends.
// sum.js
function sum(a, b) {
return a + b;
}
module.exports = sum;
// sum.test.js
const sum = require('./sum');
test('addiert 1 + 2 und ergibt 3', () => {
expect(sum(1, 2)).toBe(3);
});
o run the test, use:
jest
Or, if installed locally in a project:
npx jest