umma.dev

Github Actions

Looking at getting started with GitHub Actions.

What are Github Actions?

GitHub Actions aid towards automation. Let’s say you have a blog and you want to incorporate some kind of workflow to deploy posts when published. Github Actions are perfect for this.

Example Set Up

Create a repo in Github and create a .github/workflows directory in the repo.

In .github/workflows, create a file named github-actions.yml.

Add the following to github-actions.yml.

name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions πŸš€
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - run: echo "πŸŽ‰ The job was automatically triggered by a ${{ github.event_name }} event."
      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
      - run: echo "πŸ”Ž The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
      - name: Check out repository code
        uses: actions/checkout@v3
      - run: echo "πŸ’‘ The ${{ github.repository }} repository has been cloned to the runner."
      - run: echo "πŸ–₯️ The workflow is now ready to test your code on the runner."
      - name: List files in the repository
        run: |
          ls ${{ github.workspace }}
      - run: echo "🍏 This job's status is ${{ job.status }}."

Create a new branch for this commit and a PR, click propose new file.

Navigate to the repo, you will be able to see options such as code, issues, pull requests and actions.

Click on actions and click on all workflows. Select the workflow created and run it. You should be able to see each step and expand each step to view details.

What Next?

There are many workflows and you can see a full list of start workflows here.

There are also workflows available on the Market place.