Deployment
In its current state, Record Books is not yet ready for production deployment. This document will outline current deployment steps for deploying development/staging environments. Production deployment steps will be added in the future, but should be similar to the steps outlined here.
Overview
Record Books uses GitHub Actions for CI/CD. The CI/CD pipelines are defined in the .github/workflows
directory. The pipelines are triggered on push to the main
branch, and on pull requests to the main
branch.
Azure App Service
A azure static web app workflow is defined in azure-static-web-apps-black-stone-0cde5001e.yml
and deploys the app to Azure App Service. This static app is named record-books-test
in the Azure portal under the Static Web Apps resource. This workflow is triggered on push to the main
branch, and on pull requests to the main
branch. After a successful deployment, the app can be accessed at https://black-stone-0cde5001e.5.azurestaticapps.net/.
To make changes to the Azure deployment, the azure-static-web-apps-black-stone-0cde5001e.yml
file must be updated. App settings can be updated in the Azure portal under the Static Web Apps resource.
See the tech stack azure documentation for more information on how to deploy to Azure and manage Azure resources.
Vercel
The Vercel integration has been added to both the main project repo and the documentation repo. The integration has been linked with the GitHub organization. When a push to the main
branch is made, the Vercel integration will automatically deploy changes to Vercel platform for the changed app. The Vercel deployment for the Record Books project can be accessed at https://record-books.vercel.app/. The Vercel deployment for the Record Books documentation can be accessed at https://record-books-docs.vercel.app/.
Current deployments are under the user account of the previous project lead, Byron Ojua-Nice. A new Vercel account should be created for the record books service email, 4HRecord.books@oregonstate.edu, and the deployment should be transferred to this account. To make setting changes to the Vercel deployment, the settings can be updated in the Vercel dashboard.
Environment Variables
To hide sensitive project information, environment variables have been created to store sensitive information. Environment variables are stored localy for dev development in the .env.local
file in the root of the project. The .env.local
file is not committed to the repository.
When deploying to Azure, environment variables are stored in the setting/Environment variables section of an app. These must be set manually in the Azure portal and added to any new apps.
When deploying to Vercel, environment variables are stored in the settings/Environment variables section of the Vercel dashboard.
The following environment variables are used in the project:
- AUTH0_SECRET
- AUTH0_BASE_URL
- AUTH0_ISSUER_BASE_URL
- AUTH0_CLIENT_ID
- AUTH0_CLIENT_SECRET
- MONGODB_URI