Skip to content

LAB5_Set secrets in GitHub for CI CD

David Jones-Gilardi edited this page Feb 16, 2021 · 19 revisions

⚒️ Set secrets in GitHub for CI/CD

Objectives

In this step, we will:

  • Set Github secrets to allow database connectivity for CI/CD actions

We will cover:

  1. Configure secrets in GitHub
  2. Verify your secrets

✅ Step 1: Set secrets in GitHub

Every application should have a CI/CD (Continuous Integration, Continuous Deployment) pipeline. This allows for quick iteration of changes to production deployment by taking advantage of automation and tests to ensure everything is working properly.

After each commit a workflow is initialized to BUILD your project, EXECUTE tests and DEPLOY to Netlify. The good thing is many CI/CD tools are provided right within GitHub. Adding this capability just takes a couple steps.

✔ Within YOUR Battlestax repository in GitHub click on Settings in the top toolbar, choose Secrets from the menu on the left, and finally click the New secret button on the top right of the page. Add a secret for each of the variables we used earlier.

ASTRA_DB_USERNAME=battle_user
ASTRA_DB_PASSWORD=battle_password1
ASTRA_DB_KEYSPACE=battlestax
ASTRA_DB_ID=[the value you retrieved above from YOUR database]
ASTRA_DB_REGION=[the value you retrieved above from YOUR database]
GAMES_COLLECTION=games

✅ Step 2: Verify your secrets

This should look like:

Netlify Setup Example

Clone this wiki locally