GitHub/Actions: Difference between revisions

From Freephile Wiki
No edit summary
add several links to examples in docs
 
(4 intermediate revisions by one other user not shown)
Line 1: Line 1:
https://github.com/features/actions
https://github.com/features/actions


GitHub Actions is a powerful automation platform that is built-in to, and integrated with [[GitHub]]. With a [[YAML]]-based syntax, it is similar to the [[Ansible]] automation platform or others like Azure DevOps Pipelines, Amazon AWS CodePipeline, Jenkins, CircleCI, and GitLabCI. It allow you to automate build, test, and deployment processes within your code repository; defining workflows using YAML files and utilizing different runner environments to execute tasks.   
Microsoft's '''GitHub Actions''' is a powerful automation platform that is built-in to, and integrated with [[GitHub]]. With a [[YAML]]-based syntax, it is similar to IBM's (RedHat) '''[[Ansible]]''' automation platform or others like Microsoft's '''Azure DevOps Pipelines''', Amazon AWS '''CodePipeline''', '''[[Jenkins]]''', '''CircleCI''', '''[https://docs.gitlab.com/ci/ GitLabCI]''' etc... It allow you to automate build, test, and deployment processes within your code repository; defining workflows using YAML files and utilizing different runner environments to execute tasks.   
 
While GitHub's hosted runners only include 'windows-latest', 'macos-latest' and Ubuntu Linux<ref>https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories</ref>, you can use a Docker Image ''inside'' Ubuntu to evaluate your action on a different flavor of Linux like Debian<ref>
A snippet like this in your action will build the named image in the Ubuntu runner. Source: https://www.claudiokuenzler.com/blog/1381/how-to-run-github-ci-cd-workflows-actions-rocky-linux


While GitHubs hosted runners only include 'windows-latest', 'macos-latest' and Ubuntu Linux<ref>https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories</ref>, you can use a Docker Image ''inside'' Ubuntu to evaluate your action on a different flavor of Linux like Debian<ref>
A snippet like this in your action will build the named image in the Ubuntu runner.
<syntaxhighlight lang="yaml">
<syntaxhighlight lang="yaml">
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
Line 16: Line 17:
{{#ev:youtube|https://www.youtube.com/watch?v=TLB5MY9BBa4}}
{{#ev:youtube|https://www.youtube.com/watch?v=TLB5MY9BBa4}}


== Examples ==
The Semantic MediaWiki project has a good example of using GitHub Actions.
See the main workflow at https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/.github/workflows/main.yml


== Advanced Debugging ==
== Advanced Debugging ==
A cool advanced tool for debugging your GitHub Actions automation is https://github.com/nektos/act which allows you to run GitHub actions locally.
A cool advanced tool for debugging your GitHub Actions automation is https://github.com/nektos/act which allows you to run GitHub actions locally.


== Docs ==
https://docs.github.com/en/actions
[https://docs.github.com/en/actions/about-github-actions/understanding-github-actions Overview]
[https://docs.github.com/en/actions/sharing-automations/reusing-workflows Reusing workflows]
[https://github.com/actions/starter-workflows/blob/main/deployments/terraform.yml Terraform deployments]
[https://github.com/actions/starter-workflows/blob/main/ci/docker-image.yml Build Docker image]
[https://github.com/actions/starter-workflows/blob/main/ci/php.yml Run Composer]
[https://github.com/actions/starter-workflows/tree/main/code-scanning Code scanning] (examples for lots of tools from psalm to sonarcube)
[https://docs.github.com/en/actions/using-github-hosted-runners/connecting-to-a-private-network/about-private-networking-with-github-hosted-runners Private networking with Github-hosted runners]


{{References}}
{{References}}
Line 26: Line 47:
[[Category:DevOps]]
[[Category:DevOps]]
[[Category:Automation]]
[[Category:Automation]]
[[Category:Continuous Integration]]
[[Category:Continuous Delivery]]

Latest revision as of 14:13, 18 June 2025

https://github.com/features/actions

Microsoft's GitHub Actions is a powerful automation platform that is built-in to, and integrated with GitHub. With a Yaml-based syntax, it is similar to IBM's (RedHat) Ansible automation platform or others like Microsoft's Azure DevOps Pipelines, Amazon AWS CodePipeline, Jenkins, CircleCI, GitLabCI etc... It allow you to automate build, test, and deployment processes within your code repository; defining workflows using YAML files and utilizing different runner environments to execute tasks.

While GitHub's hosted runners only include 'windows-latest', 'macos-latest' and Ubuntu Linux[1], you can use a Docker Image inside Ubuntu to evaluate your action on a different flavor of Linux like Debian[2].

From Zero to Hero in 90 Minutes

Davide "CoderDave" Benvegnu can take you from zero to hero in 90 minutes as he covers most of the fundamentals of GitHub Actions.


Examples

The Semantic MediaWiki project has a good example of using GitHub Actions. See the main workflow at https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/.github/workflows/main.yml

Advanced Debugging

A cool advanced tool for debugging your GitHub Actions automation is https://github.com/nektos/act which allows you to run GitHub actions locally.

Docs

https://docs.github.com/en/actions

Overview

Reusing workflows

Terraform deployments

Build Docker image

Run Composer

Code scanning (examples for lots of tools from psalm to sonarcube)

Private networking with Github-hosted runners

References