Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hello, GitHub Actions continent #1

Closed
2 tasks done
bryantson opened this issue Oct 27, 2021 · 1 comment
Closed
2 tasks done

Hello, GitHub Actions continent #1

bryantson opened this issue Oct 27, 2021 · 1 comment

Comments

@bryantson
Copy link
Contributor

bryantson commented Oct 27, 2021

Welcome to Hello, GitHub Actions continent

1_HelloGitHubActions

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 - Let's create your first GitHub Actions

Learn about GitHub Actions

GitHub Actions 101

GitHub Actions is a GitHub product that allows you to automate your workflows.

image

  • 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

image

  • 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

image

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:

  1. Copy the scripts below and save into your note
  2. Create a branch named hello-username where username is your GitHub username
  3. Go to .github/workflows directory and click Add file. Type 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.
  4. Make a Pull Request to the main branch
  5. Somebody will approve the workflow.
  6. 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!"

⏭️ After you are done, you can close this issue to move forward to next one.

@github-actions
Copy link

Congratulation. You are done with Hello, GitHub Actions continent

image

Let's move to the next issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant