Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/github-actions-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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@v4
- 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 }}."
21 changes: 21 additions & 0 deletions .github/workflows/task2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: System Information Workflow

on:
push:
workflow_dispatch: # This enables manual triggering from the GitHub Actions tab

jobs:
gather-system-info:
runs-on: ubuntu-latest # Specifies the runner environment

steps:
- name: Display Runner Information
run: |
echo "Gathering system information..."
echo "Operating System: $(uname -a)"
echo "CPU Info:"
lscpu
echo "Memory Info:"
free -h
echo "Disk Usage:"
df -h
Binary file added submission/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submission/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions submission/submission9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Lab 9

## Task 1

1. Set Up a Basic GitHub Action from the [Quick Start Guide](https://docs.github.com/en/actions/quickstart)
- Create a [YAML file](../.github/workflows/github-actions-demo.yml).
- Copy the example YAML content from the guide into this file.
- Push the changes to a new branch.
- Review the workflow behavior.

2. Observations:
- We’ve created an action, which appears under the name specified in `run-name`.
![alt text](1.png)
- The example highlights the following features of GitHub Actions:
- You can define when to run the action using `on: [<event>]`.
- You can define `jobs:` to specify tasks GitHub will run.
- Within `jobs:`, the `runs-on:` setting defines the machine environment for the job.
- Each job includes a series of steps, which are commands executed in order.

## Task 2

1. Set Up a Manual Trigger for the Action
- Add `workflow_dispatch` as a trigger in the YAML file:
```yaml
on: [push, workflow_dispatch]
```
- Now, the action can also be started manually.

2. Collect System Information
- Create a new job specifically for gathering system metrics.
- Result:
![alt text](2.png)