Closed yuriaru closed 3 years ago
Here's a sample action you can use to understand the structure of an action. Put this all into a YAML file and then add that file to the .github/workflows
folder after you have set up the repo for actions:
name: Sample Action
on:
push:
branches:
- main
jobs:
sampleJob:
# You can give your job a name, select the runner to host it, and create environment variables
name: Sample Job
runs-on: ubuntu-latest
env:
MESSAGE: "Hello World"
# These are the steps that the job takes
steps:
- name: Checkout Project
uses: actions/checkout@v2
- run: echo $MESSAGE
Done
Alright, so here are the steps one needs to take to set up actions in a repo:
.github
, and another folder in there calledworkflows
, which is where the actions are stored as YAML files. You can edit them like any other element of your repo, or add new ones directly to the.github/workflows
folder if you would like.