Skip to content

Commit

Permalink
♻️ Use .env for TinaCMS Branch (#1532)
Browse files Browse the repository at this point in the history
* Update to use .env content branch

* Update .env template
  • Loading branch information
tkapa authored Oct 4, 2024
1 parent c0bb9cf commit fb59393
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .env.template_tina
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Required for TinaCMS
## https://www.gatsbyjs.com/docs/how-to/local-development/environment-variables/
TINA_CLIENT_ID=#{TINA_CLIENT_ID}
TINA_BASE_PATH=#{TINA_BASE_PATH}
TINA_CONTENT_BRANCH=#{TINA_CONTENT_BRANCH}
TINA_TOKEN=#{TINA_TOKEN}
LOCAL_CONTENT_RELATIVE_PATH=#{LOCAL_CONTENT_RELATIVE_PATH}
1 change: 1 addition & 0 deletions .github/workflows/template-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
APPINSIGHTS_INSTRUMENTATIONKEY: ${{ secrets.APPINSIGHTS_INSTRUMENTATIONKEY }}
#TODO: https://github.com/SSWConsulting/SSW.Rules/issues/1528
CONTENT_BRANCH: ${{ vars.TINACMS_CONTENT_BRANCH }}
TINA_CONTENT_BRANCH: ${{ vars.TINACMS_CONTENT_BRANCH }}
API_BASE_URL: ${{ vars.AZFUNCTIONBASEURL }}
AUTH0_DOMAIN: ${{ vars.AUTH0_DOMAIN }}
AUTH0_CLIENT_ID: ${{ vars.AUTH0_CLIENT_ID }}
Expand Down
3 changes: 1 addition & 2 deletions tina/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { defineConfig } from 'tinacms';
import { Rules } from './collections/rules';

// Your hosting provider likely exposes this as an environment variable
const branch = 'tina/sample-content';

const branch = process.env.TINA_CONTENT_BRANCH ?? 'main';
const localContentPath = process.env.LOCAL_CONTENT_RELATIVE_PATH ?? undefined;
const clientId = process.env.TINA_CLIENT_ID;
const token = process.env.TINA_TOKEN;
Expand Down

0 comments on commit fb59393

Please sign in to comment.