Skip to content

A collection of different, reusable GitHub Action workflows for use in your next project

Notifications You must be signed in to change notification settings

ncpleslie/github-actions-workflows

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Actions

This repo contains a collection of useful, reusable, GitHub Actions that can be used in your next project.

Directory of Actions

TL:DR - Got any full working examples I can just copy-paste?

In the full-examples directory you will find some complete examples that could be simply copy and pasted into your application. Just give us a star.

What are GitHub Actions?

GitHub Actions are a way of writing our automated pipelines to test, build, deploy our code. Among many other things. More can be found here along with the official documentation.

The official description is:

GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.

GitHub Actions are yaml files located in your applications .github/workflows directory.

They can be triggered by many things such as pushes to a branch, when a pull request is created, or when manually triggered. A full list of triggers can be found here

The structure of a GitHub Action workflow is as follows:

name: Example # Name of the action
on: [trigger-here] # What triggers the workflow
jobs: # The tasks the workflow contains. What is actually run
    a-name: # The name of a job
    runs-on: # The operating system to run on
    steps: # Each step of the workflow
        - uses: actions/example@v1 # A workflow provided by someone else on the market place.
...

How do I import an action here into my project

Create a directory in the root of your repo .github/workflows and copy any of the example actions from this repo.

Import an action into your main workflow with the following:

...
jobs:
  example:
    name: Example
    uses: ./.github/workflows/example.yml # full path is required

  another-example:
    name: Another example
    uses: ./.github/workflows/another-example.yml
...

Tips for effective workflows

Ignore irrelevant paths

Adding paths-ignore: - <some-path> will prevent unnecessary runs of your actions. These paths could be "**.md" to exclude the README.md or RELEASENOTES.md, etc. Or "Documentation/**" to ignore irrelevant files about the application. These can be anything.

...
on:
  push:
    paths-ignore:
      - "Documentation/**"
      - "**.md"
...

Prevent concurrent actions

Preventing concurrent actions can be a good way to reduce unnecessary runs between quick pushes to a branch, for example.

...
concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
  cancel-in-progress: true
...

Contributor Guide

If you have an Action that is missing, please feel free to create an pull request adding that action, along with an updated README on how to use that action.

About

A collection of different, reusable GitHub Action workflows for use in your next project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published