Code Monkey home page Code Monkey logo

github-actions-starter-pack's Introduction

GitHub Actions Starter Pack

✨ Example repo containing 5 GitHub Actions workflows! ✨

GitHub Actions is the easiest way to set up a Continuous Integration pipeline for your GitHub repos. You get 2,000 minutes for free every month, so might as well use them!

With this starter pack, you'll learn how to:

  • Run concurrent jobs within a workflow
  • Lint and unit test pull requests via Continuous Integration
  • Enable deployment previews on pull requests via FeaturePeek
  • Make a bot apply labels on pull requests based on branch name
  • Publish to npm and GitHub Container Registry when changes get merged to the main branch

The best way to try these out on your own is to fork this repo! You'll see the actions run every time you push a branch or open a pull request.

Workflows

Every action lives inside a workflow. You'll find all the workflows for a given repo inside the ./github/workflows/ directory. Workflows are always represented by YAML files.

You can name your workflow YAML files anything you want. It's generally a good idea to have multiple workflows that do one specific task than one large workflow that does multiple tasks.

Check out the workflows that exist in this repo, as well as the checks on pull requests to see the build logs of each action.

Secrets and environment variables

Some workflows reference secrets and environment variables that are required to be set. This is so that you don't need to hardcode sensitive keys and tokens into your code. In the workflows in this repo, I have the NPM_TOKEN and CR_PAT secrets set. You can encrypt a new secret in the Secrets section of your repo settings page.

These values are only available at build-time, not run-time. They're only available during the context of the Continuous Integration pipeline, so they won't show up anywhere in your built frontend assets that you deploy.

Other environment variables like $GITHUB_REPOSITORY and $GITHUB_TOKEN are supplied by GitHub and available automatically.

Repo info

This repo was bootstrapped from create-next-app using the with-typescript-eslint-jest template. It's configured with the following tools:

For learning how to use GitHub Actions, you can ignore most of the files in this repo -- they're there so a dummy frontend can build. All the interesting stuff is happening in the .github/workflows directory.

Useful resources

github-actions-starter-pack's People

Contributors

jasonbarry avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.