Android Auto-Build APK
This is an example of how to build an APK using GitHub Actions.
Here, we created a simple Android application that displays a Hello World!.
We then created a workflow that builds the APK and uploads it as a new release.
You maybe not want to auto-build APK for every push, so you can change the workflow to run on every push to a specific branch. For example, you can change the workflow to run on every push to the main branch suppose that you are working on dev branch in development mode.
Another idea is to write a comment in this issue to trigger the workflow. By this way, you can ask workflow to build APK for you any time you want.
Understanding GitHub Actions
Overview
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository or deploy merged pull requests to production.
GitHub Actions goes beyond just DevOps and lets you run workflows when other events happen in your repository.
For example, you can run a workflow to automatically add the appropriate labels whenever someone creates a new issue in your repository.
GitHub provides Linux, Windows, and macOS virtual machines to run your workflows, or you can host your own self-hosted runners in your own data center or cloud infrastructure.
Before we conitinue lets talk about CI/CD.
What is CI/CD?
The main concepts attributed to CI/CD are continuous integration, continuous delivery, and continuous deployment.
What is Continuous Integration?
Continuous integration ( CI) helps to ensure that software components are working together. Integration should be completed frequently; on an hourly or daily basis, if possible.
What is Continuous Delivery?
Continuous delivery (CD) picks up where continuous integration is over. While CI is the process to build and test automatically, CD deploys all code changes to the testing or staging environment in the build.
The components of GitHub Actions
- Workflow
A workflow is a configurable automated process that will run one or more jobs. Workflows are defined by a YAML file checked in to your repository and will run when triggered by an event in your repository, or they can be triggered manually, or at a defined schedule.
Workflows are defined in the .github/workflows directory in a repository, and a repository can have multiple workflows, each of which can perform a different set of tasks. For example, you can have one workflow to build and test pull requests, another workflow to deploy your application every time a release is created, and still another workflow that adds a label every time someone opens a new issue.