Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/setup/setup-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Setup Node.js
description: Set up Node.js with npm cache and install dependencies.

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: ${{ github.event.repository.name }}-frontend/package-lock.json
- name: Install dependencies
run: |
npm ci
working-directory: ${{ github.event.repository.name }}-frontend
shell: bash
18 changes: 17 additions & 1 deletion docs/WORKFLOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,31 @@ This document focuses on the Docker-specific workflow and reusable actions uniqu
<!-- omit from toc -->
## Table of Contents
- [Reusable Actions (`./github/actions`)](#reusable-actions-githubactions)
- [Setup Actions (`/setup/**/action.yml`)](#setup-actions-setupactionyml)
- [Docker Actions (`docker/**/action.yml`)](#docker-actions-dockeractionyml)
- [Workflows (`./github/workflows`)](#workflows-githubworkflows)
- [Docker Workflow (`docker.yml`)](#docker-workflow-dockeryml)


## Reusable Actions (`./github/actions`)

The following actions can be referenced from other repositories using `javidahmed64592/python-template-server/.github/actions/{category}/{action}@main`.

### Setup Actions (`/setup/**/action.yml`)

**setup-node:**
- Description: Set up Node.js with npm cache and install dependencies.
- Location: `setup-node/action.yml`
- Steps:
- Installs Node using `actions/setup-node@v4` with caching enabled
- Install npm packages
- Note: Requires a frontend directory named `<repository name>-frontend`

Usage:
```yaml
steps:
- uses: javidahmed64592/python-template-server/.github/actions/setup/setup-node@main
```

### Docker Actions (`docker/**/action.yml`)

The following actions encapsulate the steps in the Docker workflow and can be referenced locally with `uses: ./.github/actions/docker/<action>`.
Expand Down