GithubHelp home page GithubHelp logo

actions-r-us / gh-actions-samples Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 0.0 59 KB

Samples of github actions

License: MIT License

Shell 34.71% C 65.29%
github-actions actions workflow caching samples github-api github-workflow

gh-actions-samples's Introduction

gh-actions-samples

The purpose of this repo is to answer questions one might have about github actions, through examples. After you have seen the examples in this repo, you may want to also run them which is why anyone can test some of the actions by creating an issue that contains the action file's name (without the extension).

Each action will run when it detects an issue with it's name was created. It does this through the help of the issues event.


Ready:question: Go:bangbang:


I want to...

Passing Parameters...

Caching...

  • ๐Ÿ“‚ Caching on Linux...

Gathering Output

๐Ÿ’ฌ In order to use the output from a step, you need atleast 3 things

  1. Create an id for the step. Mind the syntax.
  2. Create the output(s) using the set-output command
  3. Use the id and the output name in another step

โฉ See outputs_from_step.yml

Creating environment variables

๐Ÿ’ฌ There are two ways to create environment variables:

  • โ„น๏ธ By using the env keyword on the entire workflow, a job or a step. See env. Note: This variable CAN be used in the same place where it was created
  • โ„น๏ธ Through Github Actions set-env. This will create an environment variable that can be used by all subsequent steps. Note: Variables created this way CANNOT be used in the same step where they were created, however following steps can see that variable

โฉ See step_param_from_env.yml

Creating a cache on Linux

๐Ÿ’ฌ See this Stackoverflow answer for more details

โฉ See cache_deps_ubuntu.yml. (This one requires a push or pull_request event to be triggered and this is due mostly to a restriction of the cache action.)

gh-actions-samples's People

Contributors

smac89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gh-actions-samples's Issues

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.