Looking at getting started with 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.
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.
There are many workflows and you can see a full list of start workflows here.
There are also workflows available on the Market place.