This Action for Radix CLI to integrate with the Radix platform from a GitHub Action workflow.
Want to contribute? Read our contributing guidelines
result
The standard output from execution of the rx
command.
This Action can be used to run any rx
command. The run make some assumptions:
APP_SERVICE_ACCOUNT_TOKEN
is available to the app, and this token belongs to a user or service principal who has the appropriate privileges for the operations you want to execute in the Radix cluster. See our documentation for example on how to acquire such a token in a GitHub Actions workflow. The environment variable can be set on a single step or on the entire flow.All the examples below pass the github-token
argument to the Action. Passing this argument is optional. The caveat of not passing this argument is that it gets more likely that the workflow fails because the hourly GitHub API rate limit has been exhausted. The Action uses to GitHub API to determine the most recent version of the rx
CLI.
Examples:
- name: Deploy on Radix
uses: equinor/radix-github-actions@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
args: >
create job
deploy
-a application-name
-e ${{ steps.getEnvironment.outputs.result }}
-f
-f
will ensure that the action step is followed, and won't continue until step is complete.
- name: Deploy on Radix
uses: equinor/radix-github-actions@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
args: >
create job
deploy
--context playground
-a application-name
-e ${{ steps.getEnvironment.outputs.result }}
-f
--from-config
will read information such as application-name, branch mapping etc from your radixconfig.yaml
- name: Deploy on radix
uses: equinor/radix-github-actions@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
args: >
create job
deploy
--from-config
-e ${{ steps.getEnvironment.outputs.result }}
-f
--context playground
will communicate with playground cluster, if your application resides there.
- name: Set component environment secret
uses: equinor/radix-github-actions@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
args: >
set environment-secret
--from-config
-e <your environment name>
--component <your component name>
-s <your secret name>
-v '<your secret value>'
- name: Get environment from branch mapping in Radix config for repository
id: getEnvironment
uses: equinor/radix-github-actions@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
args: >
get-config branch-environment
--from-config
-b ${GITHUB_REF##*/}
- name: Print the environment
run: echo "${{ steps.getEnvironment.outputs.result }}"
Triger Step 1 - Create pull requets with new version
workflow and set the semver option to the correct version (must be a valid semver with Major.Minor.Patch
format).
The GitHub Workflow modifies the Dockerfile
with the updated RX_VERSION
set to your semver
and create a new pull-request for you to approve.
You can also run this locally in the repository with gh workflow run ci-step1.yaml --repository github.com/equinor/radix-github-actions --field semver=1.X.X
Step 1 - Create pull requets with new version
Action 1.11.0
Step 2 - Tag commit with new version
will parse RX_VERSION
from the Dockerfile
and create/update the relevant tags.The Dockerfile and associated scripts and documentation in this project are released under the MIT License.
This is how we handle security issues