Workflows - Melomania-be/back GitHub Wiki

GitHub Actions Workflows Documentation

This repository contains GitHub Actions workflows to automate deployment, versioning, release, and CI/CD processes. Workflows are grouped into usable workflows (manually runnable or triggered in day-to-day work) and internal reusable workflows (supporting logic for other workflows).


Table of Contents

Usable Workflows (Manually Runnable)

Internal Reusable Workflows (For Composition)


Usable Workflows (Manually Runnable)

Deploy to Development Server

File: .github/workflows/deploy_dev.yml
Description: Deploys the latest built code to the development server.

Triggers:

  • On push to release-dev
  • Manual run via GitHub UI

Key Steps:

  • Build the application using _build.yml
  • Whitelist runner IP, transfer files using rsync (twice for Imunify360 compatibility)
  • Restart Node.js app with cloudlinux-selector
  • Run migrations/seeds
  • Clean up SSH and artifacts

Promote Development to Production

File: .github/workflows/promote-developpement-prod.yml
Description: Bumps the version, creates a release, merges release back into dev, and promotes it to prod.

Trigger:

  • Manual dispatch via GitHub Actions with versionType input (patch, minor, or major)

Workflow Summary:

  1. Bump Version: Uses _bump_version.yml on dev
  2. Create Release: Creates GitHub release from dev using _create_release.yml
  3. Disable Branch Protection: Disables dev and prod protection via _disable_protection.yml
  4. Update Development Branch: Merges release branch into dev
  5. Update Production Branch: Replaces prod with a fresh branch from dev
  6. Enable Branch Protection: Re-enables dev and prod protection via _enable_protection.yml

Release Development

File: .github/workflows/release-developpement.yml
Description: Handles packaging and releasing a new development build.


Release Production

File: .github/workflows/release-production.yml
Description: Handles packaging and releasing a new production version.


Internal Reusable Workflows (For Composition)

Build (Reusable)

File: .github/workflows/_build.yml
Description: Shared build step used by workflows like deploy_dev.yml.


Bump Version

File: .github/workflows/_bump_version.yml
Description: Automatically increases the version number on a given branch (patch, minor, or major).


Create Release

File: .github/workflows/_create_release.yml
Description: Creates a GitHub Release with a changelog based on version bump results.


Disable Branch Protection

File: .github/workflows/_disable_protection.yml
Description: Temporarily removes branch protection rules to allow automation.


Enable Branch Protection

File: .github/workflows/_enable_protection.yml
Description: Restores branch protection after automatic operations are complete.


Node.js CI Workflow

File: .github/workflows/node.js.yml
Description: Linting, testing, and CI steps for Node.js-based applications.
Primarily used for validation in PRs or reusable CI tasks.