Comments (3)
Getting rid of node_modules
We typically don't commit a node_modules
folder in a repository. These can often grow to be huge if your project has many dependencies. Because of the way Node works this folder is a necessary evil, but there is a way to get rid of it!
First you need to install a tool called ncc. You'll want to install this tool globally so that you can use as if it's any other CLI tool on your machine.
What ncc does is take all the dependencies within your project and compile them into a single JavaScript file. This allows you to avoid committing the node_modules
folder in your actions source code.
Install ncc
npm install -g @vercel/ncc
Using ncc
When you use ncc:
ncc build <input-file>
A new directory named dist
will be created. Within that directory you will find a file named index.js
. To tell GitHub Actions that this new index.js
file is the one that should run when your action is used a small edit to the action.yml
file needs to be made.
before:
runs:
using: "node12"
main: "index.js"
after:
runs:
using: "node12"
main: "dist/index.js"
Once you make this change you can delete the node_modules
folder and commit those changes to the repository that contains your Actions source code.
πFurther help using ncc is in the GitHub Actions documentation.
from writing-javascript-actions.
Publishing your actions
Publishing your actions is a great way to help others in your team and across the GitHub community. Although actions do not need to be published to be consumed by adding them to the marketplace you make them easier to find.
Some notable actions you will find on the marketplace are:
And that just scratches the surface of the 1600+ and counting actions you will find on the marketplace π
πFollow this guide to learn how to publish your actions to the GitHub Marketplace
from writing-javascript-actions.
The End π
It was so fun having you as a student while taking this course. I'll forever cherish our time together jh-kainos
You can keep this repository forever to remember our time... I actually encourage you to do so! This has now become your central point for notes on writing JavaScript actions π
I really do think of everything!
Make sure to visit Learning Lab for more courses on GitHub Actions and other awesome tech content.
We would love to hear what you thought about this course, share your experience with us and others in the Community forum
To fully complete your course close this issue
from writing-javascript-actions.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from writing-javascript-actions.