sarathrajsrinivasan is testing out GitHub Actions π #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub Actions Demo | |
run-name: ${{ github.actor }} is testing out GitHub Actions π | |
on: [push, workflow_dispatch] # we can add multiple event triggers like this. workflow_dispatch --> means manual trigger. | |
# We can also skip triggering the actions by mentioning [skip actions] / [skip ci] in the commit message | |
# | |
# on: | |
# push: | |
# branches: --> Here we have options such as : branches / tags / branches-ignore / tags-ignore | |
# - main | |
# - 'dev-*' --> Single * means any characters other than slashes. Eg: dev-new / dev-old | |
# - 'feature/**' --> Double * means all characters including further slashes. Eg: feature/new/button | |
# paths-ignore: --> Helpful to add either path to ignore or path to monitor. | |
# - '.github/workflows/*' | |
# on: | |
# pull_request: | |
# types: [opened, reopened] | |
# on: | |
# pull_request: | |
# types: | |
# - opened | |
# - edited | |
# workflow_dispatch: --> Note: here we need to add ":" eventhough we dont have anything to add more to it. | |
jobs: | |
Explore-Basic-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 }}." | |
Explore-Matrix: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest,windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '12' | |
- run: npm install | |
##################################################################################################################### | |
# Workflow Triggers for Github Actions: on: [push] | |
# ===================================== | |
# These triggers allow you to automate workflows based on various events that occur within your GitHub repository, | |
# enabling continuous integration, continuous deployment, and other automation tasks. | |
# | |
# Trigger Description | |
# ------------------------------------- | |
# push Triggers the workflow when changes are pushed to the repository. | |
# pull_request Triggers the workflow when a pull request is opened, updated, or synchronized. | |
# schedule Triggers the workflow at scheduled intervals. | |
# workflow_dispatch Allows the workflow to be manually triggered from the GitHub Actions tab. | |
# repository_dispatch Triggers the workflow when a repository dispatch event is triggered. | |
# issue_comment Triggers the workflow when an issue comment is created, edited, or deleted. | |
# issues Triggers the workflow when an issue is opened, edited, or deleted. | |
# pull_request_review Triggers the workflow when a pull request review is submitted, edited, or dismissed. | |
# pull_request_target Triggers the workflow on pull requests from forked repositories. | |
# push_to_delete Triggers the workflow when a branch or tag is deleted. | |
# registry_package Triggers the workflow when a package is published, updated, or deleted in a GitHub Packages registry repository. | |
##################################################################################################################### |