CI/CD-Pipelines mit GitHub Actions
Automatisieren Sie das Testen und Bereitstellen Ihrer Node.js-Anwendung, indem Sie mit GitHub Actions eine Pipeline für Continuous Integration und Delivery erstellen.
CI/CD-Pipelines mit GitHub Actions ist eine kostenlose Node.js Backend Development Bootcamp-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Node.js Backend Development Bootcamp-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Node.js Backend Development Bootcamp-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
What is CI/CD?
Continuous Integration (CI) automatically builds and tests your code on every push. Continuous Delivery/Deployment (CD) automatically ships passing code to production.
Together they catch bugs early and remove manual, error-prone release steps.
Why GitHub Actions?
GitHub Actions runs workflows directly in your repository. There is no separate server to manage, it integrates with pull requests, and it has a generous free tier for public repos.
Workflow File Location
Workflows are YAML files inside .github/workflows/. Each file describes one workflow, and a repo can have many.
// .github/workflows/ci.ymlTriggers
The on key defines what starts a workflow. Common triggers are pushes and pull requests to specific branches.
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]Jobs and Runners
A workflow has one or more jobs. Each job runs on a fresh virtual machine (a runner) you select with runs-on.
jobs:
test:
runs-on: ubuntu-latestSteps
A job is a sequence of steps. A step either runs a shell command (run) or uses a prebuilt action (uses).
steps:
- uses: actions/checkout@v4
- run: echo 'Code checked out'Setting Up Node.js
The official setup-node action installs the Node version you specify and can cache dependencies for faster runs.
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npmInstalling and Testing
With Node ready, install dependencies and run your test suite. If tests fail the job fails, blocking the merge.
- run: npm ci
- run: npm testA Complete CI Workflow
Here is a full, minimal pipeline that checks out code, sets up Node, installs, and tests on every push and pull request.
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npm testSecrets
Never commit API keys. Store them in your repo's Settings > Secrets and reference them with the secrets context. They are masked in logs.
- run: ./deploy.sh
env:
API_KEY: ${{ secrets.API_KEY }}Adding a Deploy Step
For CD, add a job that runs only after tests pass and only on the main branch, then deploys. The needs and if keys control ordering and conditions.
deploy:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- run: echo 'Deploying...'Quick Check
Test your CI/CD knowledge.
Recap
You built an automated pipeline with GitHub Actions:
- Workflows live in
.github/workflows/as YAML onsets triggers;jobsrun onruns-onrunners- Steps use prebuilt actions or run shell commands
- Install with
npm ciand runnpm testautomatically - Store credentials in secrets and gate deploys with
needs+if
Now every push is tested and safe code can ship automatically.
Häufig gestellte Fragen
Ist die Lektion „CI/CD-Pipelines mit GitHub Actions“ kostenlos?
Ja — der vollständige Text von „CI/CD-Pipelines mit GitHub Actions“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Node.js Backend Development Bootcamp-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Node.js Backend Development Bootcamp-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „CI/CD-Pipelines mit GitHub Actions“?
Automatisieren Sie das Testen und Bereitstellen Ihrer Node.js-Anwendung, indem Sie mit GitHub Actions eine Pipeline für Continuous Integration und Delivery erstellen. Du übst Node.js Backend Development Bootcamp mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Node.js Backend Development Bootcamp zu starten?
Keine Vorkenntnisse erforderlich. Node.js Backend Development Bootcamp auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.
Wie lange dauert die Lektion „CI/CD-Pipelines mit GitHub Actions“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Node.js Backend Development Bootcamp-Lektion Code schreiben und ausführen?
Ja. Jede Node.js Backend Development Bootcamp-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Containerisierung mit Docker
- Cloud-Bereitstellung (AWS/Heroku)
- Prozessverwaltung mit PM2
- CI/CD-Pipelines mit GitHub Actions