A GitHub Action to report CI/CD information for code builds and deployments from a GitHub Action workflows to Faros.
See action.yml for the full documentation for this action's inputs and outputs.
To report a code build to Faros specify CI in the event parameter and include the CI required fields.
- name: Report code build to Faros
id: send-ci-event
uses: faros-ai/[email protected]
with:
api-key: ${{ secrets.FAROS_API_KEY }}
event: CI
artifact: Docker://my-org/my-repo/artifactId
run-status: ${{ job.status }} # possible values - Success, Failed, Canceled
run-started-at: 1594938057000 # millis since epoch, ISO-8601 string or 'Now'
run-ended-at: 1594948069000 # millis since epoch, ISO-8601 string or 'Now'To report an artifact deployment to Faros specify CD in the event parameter and include the CD required fields.
- name: Report deployment to Faros
id: send-cd-event
uses: faros-ai/[email protected]
with:
api-key: ${{ secrets.FAROS_API_KEY }}
event: CD
artifact: Docker://my-org/my-repo/artifactId
deploy: CodeDeploy://MyService/<env>/deploymentId # possible env values - Dev, Prod, Staging, QA
deploy-status: Success # possible values - Success, Failed, Canceled
deploy-started-at: 1594938057000 # millis since epoch, ISO-8601 string or 'Now'
deploy-ended-at: 1594938059000 # millis since epoch, ISO-8601 string or 'Now'
run-status: ${{ job.status }} # possible values - Success, Failed, Canceled
run-started-at: 1594938057000 # millis since epoch, ISO-8601 string or 'Now'
run-ended-at: 1594948069000 # millis since epoch, ISO-8601 string or 'Now'To report the deployment of a commit to Faros specify CD in the event parameter and include the CD required fields.
- name: Report deployment to Faros
id: send-cd-event
uses: faros-ai/[email protected]
with:
api-key: ${{ secrets.FAROS_API_KEY }}
event: CD
commit-uri: GitHub://my-org/my-repo/sha
deploy: CodeDeploy://MyService/<env>/deploymentId # possible env values - Dev, Prod, Staging, QA
deploy-status: Success # possible values - Success, Failed, Canceled
deploy-started-at: 1594938057000 # millis since epoch, ISO-8601 string or 'Now'
deploy-ended-at: 1594938059000 # millis since epoch, ISO-8601 string or 'Now'
run-status: ${{ job.status }} # possible values - Success, Failed, Canceled
run-started-at: 1594938057000 # millis since epoch, ISO-8601 string or 'Now'
run-ended-at: 1594948069000 # millis since epoch, ISO-8601 string or 'Now'Running the action requires a valid Faros account and API key.
with:
debug: true # Enables debugging
no-artifact: true # Prevents an artifact from being created within Faros- no-artifact: This argument should be provided when reporting information to Faros via a CI evnet about a process that did not result in the creation of an artifact.
$ npm iActions are run from GitHub repos so add the dist folder to the commit:
$ npm run build
$ npm run package
$ git add dist
Push the changes to a branch and open a PR.
This code is made available under the MIT license.