-
Notifications
You must be signed in to change notification settings - Fork 12
LAB6_Set environment variables in Netlify
Objectives
In this step, we will:
- Set environment variables in Netlify for database connectivity in production deployments
We will cover:
✅ Step 1a: Go back to Netlify and navigate to Site settings
in the toolbar, then choose Build & deploy
from the menu on the left.
Don't forget you already have all of the needed variables in your .env file.
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
You should now have something like:
At this point, you have everything hooked up and ready to go. Your code's .env file, GitHub CI/CD actions, and now your Netlify integration ALL talking to our Astra database.
Now we are ready to start editing our application code to make things happen. From here on out as you make changes to master the whole pipeline will automatically kick in, test your app, and deploy if successful.
🏠 Home
Introduction to the JAMStack Why this is cool ? Introduction to Netlify Want to learn more ? 🛠️ II - Setup and deploy your first app
Create your BattleStax repository Setup Netlify account Summary 🛠️ III - Create your Astra instance
Register and Sign In to Astra Configure and create your database Activate Cassandra awesome 📚 IV - What can Netlify do for you
Build, Package, deploy, host Advanced features Netlify Functions Want to learn more 🛠️ V - Expose your "hello world" API
Setup your environment Make a serverless endpoint using Netlify functions Merge back to master Check your deployment in Netlify Summary 📚 VI - What are DataStax Astra and Stargate
Introduction to Astra Introduction to Stargate Want to know More 🛠️ VII - Set environment variables in your application
Creating the .env file Explore the API with HTTPie 🛠️ VIII - Set secrets in GitHub for CI/CD
Configure secrets in GitHub Verify your secrets How is this all working ? 🛠️ IX - Set environment variables in Netlify
Set environment variables in Netlify Verify your environment variables Summary 🛠️ X - Implement a CRUD Api in Astra
Creating the insertGame Netlify endpoint Connect to Astra Hook it all together Running TDD tests 🛠️ XI - Verify and Deploy in Netlify
Merge back to master Verify your deployment in Netlify Feel the enormity of your accomplishment Super secret full game option 📚 XII - Resources