This action provides the following functionality for GitHub Actions users:
- Initializing your repository file structure for Node.js Express and MySQL
- Automatically detecting .env file and setting it accordingly (Not implemented yet)
see action.yml and .github/workflows/test_clone_dispatch.yaml.
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Repository
uses: actions/IREM@v1
with:
github-repo-url: ${{ inputs.github-repo-url }}
github-user-id: ${{ inputs.github-user-id }}
github-user-email: ${{ inputs.github-user-email }}
github-token: ${{ secrets.GH_TOKEN }}
Your github repository url where you want to initialize
Your github ID
Your github Email
Your github Personal Access Token (PAT)
Please add PAT to GitHub Secrets in the repo
name: Setup Nodejs Express && MySQL Directory Structure
on:
workflow_dispatch:
inputs:
github-repo-url:
description: "GitHub Repository URL which you want to Setup"
required: true
default: ''
github-user-id:
description: "GitHub User ID"
required: true
default: ''
github-user-email:
description: "GitHub User Email"
required: true
default: ''
jobs:
git_clone_test:
runs-on: ubuntu-latest
name: Git clone test
steps:
- run: ls
- name: Setup Repository
uses: Sunwoo0110/[email protected]
with:
github-repo-url: ${{ inputs.github-repo-url }}
github-user-id: ${{ inputs.github-user-id }}
github-user-email: ${{ inputs.github-user-email }}
github-token: ${{ secrets.GH_TOKEN }}
In this example, we use [workflow_dispatch] trigger.
- Clone your repository and pull to local directory
- Create your env file about mysql. See env.sample file.
- Type npm install, then node_nodules and package-lock.json will created.
- If you want to start server, type npm start.
- To make api, add file to src/routes and router to src/index.js. See test code.
* π¦ [Your Repo]
βββ ξ package.json
βββ ξ .env.sample
βββ ο src
β βββ ο config
β β βββ ξ config.js
β βββ ο routes
β β βββ ο test
β β β βββ ξ test.ctrl.js
β β β βββ ο index.js
β β βββ ξ db.js
β β βββ ξ index.js
β βββ ξ app.js
β βββ ξ server.js
βββ ξ .gitignore
body-parser: v1.20.0
dotenv: v16.0.1
express: v4.18.1
mysql2: v2.3.3
nodemon: v2.0.18
* π¦ IREM
βββ ο .github
β βββ ο workflows
β β βββ ξ test_clone_dispatch.yml
βββ ο src
β βββ ο make_appserver.sh
β βββ ο make_config.sh
β βββ ο make_env_sample.sh
β βββ ο make_gitignore.sh
β βββ ο make_package_dot_json.sh
β βββ ο make_routes.sh
β βββ ξ make_src_directory.sh
βββ ξ Dockerfile
βββ ξ action.yml
βββ ξ main.sh
The scripts and documentation in this project are released under the MIT License.
- Sungkyunkwan Univ CSE Sunwoo Kim κΉμ μ° (Sunwoo0110) [email protected]
- Sungkyunkwan Univ CSE Jihoon Yu μ μ§ν (jihooni0914) [email protected]