The god of this planet wants your journey to be useful and pleasant one. However, it is still nice to give a proper thanks to this planet...
Your mission
[ ] Learn about GitHub Actions
[ ] Activity - Write your first GitHub Actions
Consider this as GitHub Actions 101
GitHub Actions overview
GitHub Actions is a GitHub product that allows you to automate your workflows.
Workflows stored as yml files
Fully integrated with GitHub
Respond to GitHub events
Live logs and visualized workflow execution
Community-powered workflows
GitHub-hosted or self-hosted runners
Built-in secret store
GitHub Actions Marketplace
Discover open-source Actions across multiple domains
~10,000 Actions (and counting...)
Verified creators
Reference these Actions directly in your workflow
Integrated into the GitHub editor
High level architecture of GitHub Actions
Basic syntax
# Defines the name
name: Super Linter Workflow
# Event that will get triggered. In this case, it gets triggered by push event
on:
push:
# Different jobs can be defined
jobs:
# Name of job
lint:
# Name of this job
name: Lint Code Base
# Type of runner. In this case, it is a default GitHub Actions runner
runs-on: ubuntu-latest
# You can define different steps
steps:
# First, checkout the code from the repo
- uses: actions/checkout@v2
# Uses the super-linter from GitHub Action plugin
- uses: github/super-linter@v3
env:
# GitHub secret value can be used
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Let's create your first GitHub Actions
You need to create a GitHub Actions to say a proper greeting with a message:
Thank you for warm welcoming! My name is xxx
I will enjoy my time in this wonderful GitHub Actions planet!
To do this you need to do the following steps:
Copy the scripts below and save into your note
Create a branch named hello-username where username is your GitHub username
Go to .github and add a file name in following format action-hello-username.yml where you will replace username with your own GitHub username. Save the file by commiting to the directory.
Make a Pull Request to the main branch
Somebody will approve the workflow.
You can then run your workflow
# Change this line with username with your GitHub username
name: Hello from @username
on:
workflow_dispatch:
inputs:
myName:
description: "Please type in your name"
required: true
default: ''
jobs:
Hello-GitHub-Actions:
runs-on: ubuntu-latest
name: Just saying "hi"
steps:
- name: Hello, GitHub Actions planet
run: |
echo "Thank you for warm welcoming! My name is ${{ github.event.inputs.myName }}"
echo "I will enjoy my time in this wonderful GitHub Actions planet!"
Welcome to Send Message continent
Your mission
Consider this as GitHub Actions 101
GitHub Actions overview
GitHub Actions is a GitHub product that allows you to automate your workflows.
GitHub Actions Marketplace
High level architecture of GitHub Actions
Basic syntax
Let's create your first GitHub Actions
You need to create a GitHub Actions to say a proper greeting with a message:
To do this you need to do the following steps:
hello-username
where username is your GitHub username.github
and add a file name in following formataction-hello-username.yml
where you will replace username with your own GitHub username. Save the file by commiting to the directory.