Sätt upp CI/CD med GitHub Actions
Utvecklare gynnas av att skapa strukturerade, kopiera-och-klistra-klara handledningar med bildanvisningar för dokumentation.
Visa förhandsvisning av in- och utdata
Indata
- Uppgift / vad som ska uppnås
- Set up a CI/CD pipeline with GitHub Actions for a Node.js app
- Svårighetsnivå
- Intermediär — Grundläggande kunskaper antas
- Inkludera anteckningar om bildplacering?
- Ja — Lägg till [BILD] markörer med beskrivningar
- Verktyg/programvara som krävs
- GitHub account, Node.js 18+, a repository with npm scripts
Utdata (utdrag)
How to Set Up a CI/CD Pipeline with GitHub Actions
Prerequisites: GitHub account, Node.js 18+, a repo with `npm test` and `npm run build`.
Step 1 — Create the workflow file. In your repo, add `.github/workflows/ci.yml`. [Image: screenshot of the file tree showing the new workflow folder]
Step 2 — Define the trigger. Set the workflow to run on every push and pull request to main:
```yaml
on:
push:
branches: [main]
```
Step 3 — Add the test job...