Skip to content
/ git-template Public template

Personal git template with bundler and github actions

Notifications You must be signed in to change notification settings

DamChtlv/git-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal git template / starter

🛠 Tools used:

✨ Features

⌨ Auto formatted commits & auto-changelog
  • This repo uses a simple commit convention, which gets automatically formatted properly and also used to generate a changelog

💡 INFO: Commit message should be composed like this: action|context|details

Example: commit fix ajax used wrong ajax url will become 🐛 Fix(ajax): used wrong ajax url,
it will also be added into 🐛 Bug fixes section inside latest version of changelog automatically (see CHANGELOG.md)

🚀 Auto install, build & deploy with CI/CD (based on branches)
  • Automatically install assets (from managers like node modules... using bun action)
  • Automatically push code on remote servers (using correct SFTP env based on pull requests / branches)
  • Automatically configure IP whitelisting on hosting (specific to o2switch hosting)
  • Automatically trigger 3rd party actions post deploy (auto clear cache...)
🔍 Project quick view (badges)
  • See deploy states per environment (failed, success...)
🎢 Quick launch a WP server (docker is mandatory)
  • Update content of .wp-env.json with your preferences (php version, theme, plugins...)
  • Use wp-env scripts like: bun run wp:start / bun run wp:stop
  • More informations about wp-env here

🛠 Setup

  1. Clone this repository (using "Use template" or directly with https|ssh|zip)

  2. Install package manager (optional if bun is already installed)

curl -fsSL https://bun.sh/install | bash
  1. Install git hooks manager (optional if package.json already has prepare script)
bunx husky install
  1. Update continuous integration config files (Github readme, actions...)
  • Edit deployment files paths located in:

    • .github/workflows/deploy-preprod.yml
    • .github/workflows/deploy-prod.yml
  • Set repository secrets below in repository settings:

    PREPROD_FTP_HOST = (example.com)
    PREPROD_FTP_USER = (johndoe)
    PREPROD_FTP_PASS = (not123)
    
    PROD_FTP_HOST = (example.com)
    PROD_FTP_USER = (johndoe)
    PROD_FTP_PASS = (not123)
  1. Update badges in README.md
    Example:
    deploy-preprod
    deploy-prod
  • Copy code below into .github/README.md and change repository paths!
# Project

### Status
![deploy-preprod](https://github.com/DamChtlv/git-template/actions/workflows/deploy-preprod.yml/badge.svg?branch=release/preprod)
![deploy-prod](https://github.com/DamChtlv/git-template/actions/workflows/deploy-prod.yml/badge.svg?branch=release/prod)

❔ How to use

  1. Install scripts
bun i
  1. Run scripts (from package.json)
bun run script-name
  1. Build assets
bun run build ./index.js --outdir ./build
  1. Spin up a static server on localhost:5000
bunx serve folder-name
  1. Run tests
bun test

💡 Improvments / ideas

  • Force lint commits messages using commitlint?
  • Automatically generate a changelog based on commits using Git Cliff?

About

Personal git template with bundler and github actions

Resources

Stars

Watchers

Forks

Languages