DEV Community

Cover image for Minisauras: A Github action to minify CSS and JS files
Shunjid Rahman Showrov
Shunjid Rahman Showrov

Posted on • Edited on

Minisauras: A Github action to minify CSS and JS files

πŸ‘‹ Hi Everyone,

We are TeamTigers, a group of undergrad students studying Bachelor of Science in Software Engineering. And here is our submission for #ActionsHackathon.

Our Workflow

Minisauras is an open-source CI/CD automation tool based on GitHub Actions that pulls all the desired JavaScript and CSS files from your base branch, minify them and creates a pull-request with a new branch.

How it works

  • Traverse through a given directory (if not provided, traverse from root), finds all the JavaScript & CSS files within it and it's sub-directories.
  • Afterwards, Minisauras minify all those files.
  • Finally, it creates a new branch in your repository, push those changes and creates a pull request that can be merged in your base branch.

Submission Category:

We are submitting this action in following categories:

πŸ“Œ DIY Deployments (Primary)
πŸ“Œ Wacky Wildcards (Secondary)

Yaml File or Link to Code

Users' Guideline

  • Create a personal access token.
  • Then setup a secret using that personal access token in your desired repository.
  • Create a workflow. For example: main.yml under (.github/workflows) directory.
  • In the workflow, provide following things:
    • Personal access token. For example: secrets.TOKEN if you set your secret with a name 'TOKEN'.
    • The desired directory in which you want to minify CSS and JS files. For example: './' for root and 'src/' for src directory.
- name: minisauras
  uses: TeamTigers/minisauras@v2.0.0
  env:
    GITHUB_TOKEN: ${{ secrets.TOKEN }}
  with:
    directory: 'src/' # all files under 'src' directory
Enter fullscreen mode Exit fullscreen mode

Minisauras Repository :

GitHub logo TeamTigers / minisauras

An open-source CI/CD automation tool based on :octocat: GitHub Actions that pulls all the JavaScript and CSS files from your base branch, minify them and creates a pull-request with a new branch.

banner

minisauras star releases GitHub Hackathon Hits

Minisauras πŸŽ‰

Minisauras is an open-source CI/CD automation tool based on :octocat: GitHub Actions that pulls all the JavaScript and CSS files from your base branch, minify them and creates a pull-request with a new branch.

How it works

  • Traverse through a given directory (if not provided, traverse from root), finds all the JavaScript & CSS files within it and it's sub-directories.
  • Afterwards, Minisauras minify all those files.
  • Finally, it creates a new branch in your repository, push those changes and creates a pull request that can be merged in your base branch.

Usage

  • Create a personal access token.
  • Then setup a secret using that personal access token in your desired repository.
  • Create a workflow. For example: main.yml under (.github/workflows) directory.
  • In the workflow, provide following things
    • Personal access token. For example: ${{ secrets.TOKEN }} if you set your secret with a name 'TOKEN'.
    • The desired directory in which you…

Additional Resources / Info

πŸ’‘ Example and output

Here is an example repository that shows the usage of GitHub Action minisauras. You can see there, how minisauras has minified all the CSS & JS files of this repository and sent a Pull Request over there.

GitHub logo TeamTigers / minisauras-example

An example repository to show how to use @TeamTigers/minisauras in a repository.

Below is a pull request sent by Minisauras with changes in some CSS and JavaScript files:

cat-pr

Additionally, in the GitHub Action's console you will see the confirmation of pull request sent by Minisauras.

Our journey πŸ€—

It was a fun participating in GitHub Actions Hackathon. Usually in academic projects we develop Web or Mobile applications. We've participated in so many national & international Hackathons too. But in #ActionsHackathon we did something really new !!! We've faced so many challenges during the development period. Below is our 'Action Development Life Cycle' (ADLC). Obviously, this journey isn't over yet. We'll still be maintaining this project after the hackathon. So, you can submit issues for improvements and new feature requests at anytime.

Timeline

Here are some really good resources that helped us building Minisauras:

All 3 Contributors

[deleted user] image

[Deleted User]



Top comments (21)

Collapse
 
prafulla-codes profile image
Prafulla Raichurkar

This is awesome 😁

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Thanks a lot @Prafulla. We're glad you liked it. Best of luck. πŸ˜„ πŸŽ‰

Collapse
 
prafulla-codes profile image
Prafulla Raichurkar

Best of luck πŸŽ‰

Collapse
 
mmr_ashiq profile image
Mizanur Rahman Ashiq

Nice Idea 😳

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Thank you so much 😊

Collapse
 
andrewbaisden profile image
Andrew Baisden

Wow nice good job creating this.

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Thank you so much. We're glad you loved it πŸ˜„

thanks

Collapse
 
anupamakib profile image
Mir Anupam Hossain Akib

Wow 😍

Collapse
 
jinnatul profile image
Md Zinnatul Islam Morol

Thank you so much 😊

Collapse
 
mkshuvo profile image
Mohsin Khan Shuvo

I like it.

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

We're glad you liked. We would like to hear more about your experience of using Minisauras.

Collapse
 
shaharia0 profile image
Md. Shaharia Chowdhury

great brothers !! keep it up :)

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Thank you so much. You can check our source code too πŸ˜„.

Collapse
 
ender_minyard profile image
ender minyard

This is great.

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Glad you liked πŸ˜„ πŸŽ‰

Collapse
 
ponickkhan profile image
Md.Rafiuzzaman Khan πŸ‡§πŸ‡©

Cool idea! Keep it up πŸ‡§πŸ‡©

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Glad you liked it. You may check our source code here. We would love to hear more from you. πŸ˜„

Collapse
 
maulik profile image
Maulik

Awesome

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Thank you so much, Maulik πŸ˜„. You may check our source code here. We would love to hear more from you.

Collapse
 
ratonbiswas profile image
Raton Biswas

Nice Job my big brothers. Another winning project.❀

Collapse
 
shunjid profile image
Shunjid Rahman Showrov

Thanks for you great compliment, Raton 😊
thanks