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
Β 
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
Β 
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
Β 
mmr_ashiq profile image
Mizanur Rahman Ashiq β€’

Nice Idea 😳

Collapse
Β 
shunjid profile image
Shunjid Rahman Showrov β€’

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
Β 
ender_minyard profile image
ender minyard β€’

This is great.

Collapse
Β 
shunjid profile image
Shunjid Rahman Showrov β€’

Glad you liked πŸ˜„ πŸŽ‰

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
Β 
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