We start our exploration in the GitHub Marketplace, where we discover different Actions. For our example, we select 'Deploy Docker to AWS'. This Action takes a Docker application and deploys it to an S2 instance of AWS.
What does this AWS Action require to work?
The Action requires us to configure several variables for it. Through Secrets, we can configure an access key ID, a secret access key, a default region and an .env. This is what the Action needs to upload a Docker application to an AWS S2 instance.
The values of these variables are obtained from our AWS account credentials. They are stored in the GitHub repository as secrets, protecting their security.
From there, we can copy the Workflow that uses these secrets in case of need if we want to upload a Docker application to AWS.
How can we verify and debug a Workflow?
Once the Workflow is deployed, it is important to check the logs to verify that it is working correctly. In the actions tab, you can see the logs of each Workflow execution.
For example, when exploring a failed Workflow, we can see the error 'process completed with exit code 1', indicating that the process was not completed correctly. By detailing each of the jobs, we can identify the step where the failure occurred.
Although GitHub indicates whether a job has been successful or not, it is always important to check the logs, as there may be errors not detected by GitHub.
How to troubleshoot Workflows?
When reviewing the logs, we noticed that the Workflow greeting 'greetings and secrets' was not being displayed correctly. The analysis of the logs revealed that the variable 'greeting' was only configured for the job 'greeting variables' and not for the job 'greetings and secrets'.
To fix this problem, it is necessary to add the variable 'greeting' to the job 'greetings and secrets'. With this fix, the greeting is displayed correctly in the logs, indicating that the Workflow is working as expected.
How to avoid errors when creating new Workflows?
When creating a new Workflow, it is essential to test it several times and carefully review all logs. In this way, we can be sure that the Workflow is working as expected.
Want to see more contributions, questions and answers from the community?