Menu

Post image 1
Post image 2
1 / 2
0

GitHub Actions CI/CD Complete Guide

DEV Community: cicd·WDSEGA·3 days ago
#CdsyBBoU
#dev#fullscreen#actions#node#uses#article
Reading 0:00
15s threshold

Introduction GitHub Actions is one of the most popular CI/CD tools today. This guide covers everything from basics to advanced techniques. Basic Workflow Structure name : CI/CD Pipeline on : push : branches : [ main , develop ] pull_request : branches : [ main ] jobs : test : runs-on : ubuntu-latest steps : - uses : actions/checkout@v4 - uses : actions/setup-node@v4 with : node-version : ' 18' - run : npm ci - run : npm test Enter fullscreen mode Exit fullscreen mode Matrix Builds Test across multiple environments: strategy : matrix : node-version : [ 16 , 18 , 20 ] os : [ ubuntu-latest , windows-latest ] Enter fullscreen mode Exit fullscreen mode Caching Speed up builds with caching: - uses : actions/setup-node@v4 with : node-version : ' 18' cache : ' npm' - uses : actions/cache@v3 with : path : ~/.cache/pip key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} Enter fullscreen mode Exit fullscreen mode Reusable Workflows Create reusable workflow: # .github/workflows/reusable-test.yml on :…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More