All Projects → bitoiu → node-js-action-template

bitoiu / node-js-action-template

Licence: other
Template for new GitHub Actions running NodeJS

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to node-js-action-template

github-actions-all-in-one-project
Automatically add an issue or pull request to specific GitHub Project when you create them.
Stars: ✭ 27 (-18.18%)
Mutual labels:  github-actions
blackcater
Using Node.js to generate my Github profile readme automatically.
Stars: ✭ 84 (+154.55%)
Mutual labels:  github-actions
creatly-backend
🚀 Creatly backend app
Stars: ✭ 71 (+115.15%)
Mutual labels:  github-actions
vidyabhandary
Self updating profile readme for github
Stars: ✭ 36 (+9.09%)
Mutual labels:  github-actions
github-deploy-actions
This action will auto deploy to target branch when it get triggered
Stars: ✭ 24 (-27.27%)
Mutual labels:  github-actions
pin-github-action
Pin your GitHub actions to a specific hash
Stars: ✭ 38 (+15.15%)
Mutual labels:  github-actions
translation-action
GitHub action that translates any text to any language supported by chosen provider.
Stars: ✭ 25 (-24.24%)
Mutual labels:  github-actions
actions
A Collection of GitHub Actions
Stars: ✭ 91 (+175.76%)
Mutual labels:  github-actions
nextjs-github-pages
🚀 Deploy a Next.js app to Github Pages via Github Actions.
Stars: ✭ 89 (+169.7%)
Mutual labels:  github-actions
upload-rust-binary-action
GitHub Action for building and uploading Rust binary to GitHub Releases.
Stars: ✭ 47 (+42.42%)
Mutual labels:  github-actions
WebApiStartTemplate
Web API Visual Studio Template.
Stars: ✭ 15 (-54.55%)
Mutual labels:  template-project
gh fsync
🔄 GitHub action to sync files across repos in GitHub
Stars: ✭ 17 (-48.48%)
Mutual labels:  github-actions
awscredswrap
awscredswrap uses temporary credentials for the specified iam role to set a shell environment variable or execute a command.
Stars: ✭ 15 (-54.55%)
Mutual labels:  github-actions
django-github-digitalocean
Continuously Deploying Django to DigitalOcean with Docker and GitHub Actions
Stars: ✭ 45 (+36.36%)
Mutual labels:  github-actions
generate-og-image
Generate open graph images with Github Action from Markdown files
Stars: ✭ 32 (-3.03%)
Mutual labels:  github-actions
action-ansible-playbook
⚙️ A GitHub Action for running Ansible playbooks
Stars: ✭ 133 (+303.03%)
Mutual labels:  github-actions
setup-arduino-cli
GitHub Action to setup Arduino CLI
Stars: ✭ 59 (+78.79%)
Mutual labels:  github-actions
riak-haskell-client
A fast Haskell client library for the Riak decentralized data store
Stars: ✭ 48 (+45.45%)
Mutual labels:  github-actions
rails7-on-docker
Working Rails 7 demo application without JavaScript bundling, running in Docker. No node.js or webpack.
Stars: ✭ 111 (+236.36%)
Mutual labels:  github-actions
webring
“วงแหวนเว็บ” แห่งนี้สร้างขึ้นเพื่อส่งเสริมให้ศิลปิน นักออกแบบ และนักพัฒนาชาวไทย สร้างเว็บไซต์ของตัวเองและแบ่งปันการเข้าชมซึ่งกันและกัน
Stars: ✭ 125 (+278.79%)
Mutual labels:  github-actions

node-js-action-template

This repository offers a template to build a GitHub Action on NodeJS without really having to understand the complexities of containers - although I recommend you do at some point. My hope is that by letting you feel the power of Actions quicker and hassle free, you'll be more motivated to develop new ones and learn the rest of the technical context.

🚧 GitHub Actions is still on Private Beta, sign-up for access 🚧

Developing your Action locally

All your code is under the src folder:

  1. cd src
  2. npm install

After the project is setup you can just run it as:

GITHUB_EVENT_PATH="sample-payload.json" node action.js

GITHUB_EVENT_PATH is an environment variable in Actions where the event payload is stored for analysis during execution. For local testing there's a file src/sample-payload.json which stores the sample payload of a push event. If you're planning on creating a workflow that triggers on another type of event, you can just fetch a sample payload and replace the contents of that file.

Testing the Action on GitHub.com

First of all you'll need create a new repository on GitHub.com and push the local changes to it. Another option would have been to fork this repository to your account and clone it from there. You might also want to go into package.json and Dockerfile to change things like Action name, author, description, icon, colour, etc.

After that just follow the documentation on how to create a new workflow and import your action: https://developer.github.com/actions/creating-workflows/creating-a-new-workflow/.

Design considerations

If you've been working with NodeJS you'll surely know since you've started reading this line there are 12 new frameworks and 6 new HTTP libraries to consume an API. While suggestions will be welcome and if valid taken into the project, I'm trying to keep things simple as far as default imports go, but I know opinions will differ wildly on this. Currently the default dependencies on package.json are:

Pull Requests and Issues are Welcome

If you find something that can be improved, or best practices that could be adopted in anything regarding NodeJS, Containers or GitHub Actions themselves, please send a pull request.

:octocat:❤️

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].