Search for a command to run...
Comprehensive guide for setting up and using GitHub Actions for CI/CD workflows in your repositories.
This guide provides detailed instructions for setting up GitHub Actions in your repositories and creating efficient CI/CD workflows.
name: CI/CD Pipeline
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm test
Secrets Management
steps:
- name: Use secret
env:
API_KEY: ${{ secrets.API_KEY }}
OIDC Integration
jobs:
deploy:
permissions:
id-token: write
contents: read
Dependency Caching
steps:
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Workflow Optimization
Security
Maintenance