GitHub Actions gained lot of traction recently and well poised to change the software deliver process.it is clear at Recent Microsoft Build Event that GitHub is Microsoft’s first Priority, all new feature will be coming to GitHub first, Azure Devops is not going any where, but i think GitHub should be the first choice if you are starting up new project.
GitHub actions lets you Build , Test and deploy code directly with in the repository, i personally like this ,way better that using a external CI/CD tools.GitHub Actions should be the first choice if you are using GitHub.As of writing this blog (June 2020) , Actions are not yet available in GitHub Enterprise but expected by Summer 2020.
Workflows are custom automated processes that you can set up in your repository to build, test, package, release, or deploy any code project on GitHub.collection of Actions make a workflow like checkout.Workflows are configured using YAML syntax , and should be stored in the .github/workflows directory in the root of your repository.
GitHub repository has actions tab.
GitHub Actions page has recommended Actions based on the project Type , Mine is .Net core application so my recommendations were .Net Core Project Workflow ,That is slick. lets go ahead with .Net Core workflow by click “Setup this Workflow”. and a yaml files gets added to Workflow directory.
Work Flow Walk through.
on: push: branches: [ master ] pull_request: branches: [ master ]
On push master triggers workflow for changes committed to master or Pull request Merges into master.workflow can also be triggered based on schedule.
on: schedule: - cron: '0 * * * *'
you can run actions on Github hosted runner or self hosted agents.
Check out action is standard action that must be included in workflow before all the other actions, check out action checks out code to runner.
steps: - uses: actions/checkout@v2
i kept workflow file simple , but in real world scenario there will be more actions with in workflow file Build, Test, publish Etc.
Upon committing the file workflow gets trigger.
i strongly believe GitHub action are the future.Thank you for reading.Stay well.
Useful links :
Twitter : @azsrini