Solsta GitHub Actions Integration

The YAML snippets below call our predefined Solsta GitHub actions to deploy and promote releases within the Solsta ecosystem. Deploying consists of converting and uploading raw files (assets) to a bucket in order to make releases available for download by Solsta desktop clients. These sample YAML snippets are meant to demonstrate a basic deployment and promotion using the Solsta deployment tools running within a docker container. You can modify these snippets as necessary to fit your GitHub Actions deployment pipeline. 

Runner Requirements

Since both deployment and promotion actions run within our docker container, they must be run on Linux. We recommend using the “ubuntu-latest” shared runner. Read more about GitHub-hosted runners.

If you prefer to run these actions in your own linux hosted runner, it will need to have the following components installed:

  • docker

Authentication

The Solid State Networks deployment tools require authentication using M2M credentials that were provided when your company signed up for Solsta. Contact your company’s primary contact with Solid State Networks or open a support ticket for assistance.
 
The YAML examples below require the credentials to be set as two repository secrets before executing a pipeline.
  • SNXD_CLIENT_ID
  • SNXD_CLIENT_SECRET

These variables can be set in the Settings > Secrets > Actions section of your GitHub repository where they can be protected and masked (see image below for an example). 

Setup

The Solsta deployment examples require the creation of Products, Environments and Repositories within the Solsta deployment database. Please see the articles below for how to create those objects using the Solsta Desktop Application.

Note: As of September 28th, 2022 these objects must be created on the Solsta Desktop Application. The upcoming iteration of this sample GitHub action will allow the objects to be created dynamically as part of the deployment pipeline.

Solsta Deploy Action

In the deployment YAML below, custom CI/CD variables are defined for the following:
  • working_directory: Relative path to folder within build checkout directory. The contents of the folder will be deployed.
  • console_version: Version of the Solsta deployment tools. Do not change this unless instructed to do so by Solsta support staff.
  • scripts_version: Version of Solsta deployment scripts. Do not change this unless instructed to do so by Solsta support staff.
  • release_version: An environment variable or build parameter to use as a version within Solsta (optional)
  • target_product: Target product for deployment
  • target_environment: Target environment within containing product
  • target_repository:  Target repository within containing environment
Note that the values for product, environment and repository are case-sensitive. 
Insert YAML Snippet
To use this Solsta deployment action, insert the YAML snippet below into your GitHub actions YAML after you build or compile your release(s). As mentioned above, you can adjust this YAML within your pipeline to best suite your needs. The Solsta deployment action only needs to be pointed to the path containing your cooked, ready-to-deploy data (or build artifacts). This can be done by editing the value of the working_directory variable. Note that the docker instance  executing the deployment action needs to have access to the files in that path.
Example:
working_directory: /github/workspace/mybuilds/v38.1.2/

See the docker container fileystem section on GitHub Docs for more information. 

Solsta Deploy YAML

				
					    steps:
    - name: Deploy Build Assets from bin/ directory
      uses: snxd/deploy-github-deploy-action@main
      with:
        working_directory: 'bin/'
        console_version: '6.1.2.51'
        scripts_version: '3.7.18'
        release_version: '1.0'
        target_product: 'llamacraft'
        target_environment: 'dev-nightly'
        target_repository: 'game-client'
        solsta_client_id:  ${{ secrets.SNXD_CLIENT_ID }}
        solsta_client_secret:  ${{ secrets.SNXD_CLIENT_SECRET }}

				
			

Solsa Promote Action

In the promote sample below, custom CI/CD variables are defined for the following:
  • console_version: Version of the Solsta deployment tools. Do not change this unless instructed to do so by Solsta support staff.
  • scripts_version: Version of the Solsta deployment scripts. Do not change this unless instructed to do so by Solsta support staff.
  • source_product: Source product for promotion
  • source_environment: Source environment within containing product
  • source_repository: Source repository within containing environment
  • target_product: Target product for promotion
  • target_environment: Target environment within containing product
  • target_repository: Target repository within containing environment
Note that the values for product, environment and repository are case-sensitive. 
This action will promote the release currently assigned from the source Product, Environment and Repository to the target Product, Environment and Repository. If the target environment has an update path count value greater than zero, the process will automatically create delta update paths within the target Environment and Repository as part of the promotion step.

Solsta Promote YAML

				
					    steps:
    - name: Promote a Release from Dev to QA
      uses: snxd/deploy-github-promote-action@main
      with:
        console_version: '6.1.2.51'
        scripts_version: '3.7.18'
        source_product: 'llamacraft'
        source_environment: 'dev-nightly'
        source_repository: 'game-client'
        target_product: 'llamacraft'
        target_environment: 'qa-internal'
        target_repository: 'game-client'
        solsta_client_id:  ${{ secrets.SNXD_CLIENT_ID }}
        solsta_client_secret:  ${{ secrets.SNXD_CLIENT_SECRET }}