Skip to content

Commit

Permalink
Use env values in configs (#1554)
Browse files Browse the repository at this point in the history
* Use env values in configs

* deploy cms to new org

* add deployment to old cms config

* deploy auth cms to the new org

* seperate config auth cms old

* add manual deployment

* add push trigger

* add branch to trigger

* use new org auth url

* add whitelist callback

* deploy to productin

* update whitelist urls

* remove hard coded url

* remove hard coded url - WIP

* update whitelist config

* redeploy cms and auth

* Update Page “online-communities”

* cleanup

* use old pipeline trigger

* fix event issue

* Test deployment

---------

Co-authored-by: bgharbi <[email protected]>
Co-authored-by: AmalyStark <[email protected]>
  • Loading branch information
3 people authored Nov 7, 2023
1 parent 508742e commit 78bf840
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 100 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/netlify-cms-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Build and Deploy Netlify CMS Auth
on:
push:
branches:
- deploy/netlify-cms-auth
- deploy/netlify-cms-auth
workflow_dispatch:

jobs:
build_and_deploy:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/netlify-cms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
name: Build and Deploy
environment:
name: Netlify CMS ${{ github.ref_name }}
url: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-netlify-cms.pages.dev
url: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-netlify-cms-byd.pages.dev
permissions:
contents: read
deployments: write
Expand Down Expand Up @@ -47,10 +47,11 @@ jobs:
- name: Build Netlify CMS
run: yarn workspace @starknet-io/netlify-cms build
env:
VITE_LIVE_PREVIEW_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-website.pages.dev
VITE_LIVE_PREVIEW_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev
VITE_GIT_BRANCH_NAME: ${{ github.ref_name }}
VITE_API_BASE_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-website.pages.dev/api
VITE_DATA_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-website.pages.dev/data
VITE_API_BASE_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev/api
VITE_DATA_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev/data
VITE_BACKEND_AUTH_URL: https://netlify-cms-auth.haim-6b2.workers.dev

- name: Deploy Netlify CMS
uses: cloudflare/pages-action@1
Expand All @@ -60,4 +61,4 @@ jobs:
projectName: starknet-netlify-cms
directory: workspaces/netlify-cms/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
branch: main
14 changes: 7 additions & 7 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,17 @@ jobs:
VITE_ALGOLIA_INDEX: ${{ github.ref_name == 'production' && 'production' || 'dev' }}
VITE_ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
VITE_ALGOLIA_SEARCH_API_KEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }}
VITE_CF_STREAM_URL: ${{ secrets.NEW_CF_STREAM_URL }}
VITE_ED_VIDEO_ID_1: ${{ secrets.NEW_VITE_ED_VIDEO_ID_1 }}
VITE_ED_VIDEO_ID_2: ${{ secrets.NEW_VITE_ED_VIDEO_ID_2 }}
VITE_ED_VIDEO_ID_3: ${{ secrets.NEW_VITE_ED_VIDEO_ID_3 }}
VITE_ED_VIDEO_ID_4: ${{ secrets.NEW_VITE_ED_VIDEO_ID_4 }}
VITE_CF_STREAM_URL: ${{ secrets.CF_STREAM_URL }}
VITE_ED_VIDEO_ID_1: ${{ secrets.VITE_ED_VIDEO_ID_1 }}
VITE_ED_VIDEO_ID_2: ${{ secrets.VITE_ED_VIDEO_ID_2 }}
VITE_ED_VIDEO_ID_3: ${{ secrets.VITE_ED_VIDEO_ID_3 }}
VITE_ED_VIDEO_ID_4: ${{ secrets.VITE_ED_VIDEO_ID_4 }}

- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.NEW_CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.NEW_CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: starknet-websites
directory: dist/client
workingDirectory: workspaces/website
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/website_old.yml

This file was deleted.

4 changes: 4 additions & 0 deletions _data/pages/online-communities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ blocks:
hasIcon: true
custom_title: Starknet Ecosystem
custom_external_link: https://twitter.com/StarknetEco
- link:
hasIcon: true
custom_title: Starknet France
custom_external_link: https://twitter.com/StarknetFr
- link:
hasIcon: true
custom_title: "Starknet Gaming "
Expand Down
2 changes: 1 addition & 1 deletion workspaces/cms-config/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const CMSConfig = {
name: "github-yuki",
repo: "starknet-io/starknet-website",
branch: "dev",
base_url: "https://netlify-cms-auth.yukilabs.workers.dev",
base_url: "https://netlify-cms-auth.haim-6b2.workers.dev",
preview_context: "Vercel – starknet-website",
},
publish_mode: "editorial_workflow",
Expand Down
2 changes: 2 additions & 0 deletions workspaces/netlify-cms-auth/src/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ function postMessageHTML({ status, data }: PostMessageHTMLArgs) {
const allowedOrigin = (
message.origin === 'http://localhost:1234' ||
message.origin === 'http://127.0.0.1:1234' ||
message.origin === 'https://starknet-netlify-cms-byd.pages.dev' ||
/^https:\\/\\/[-_\\w]+\\.starknet-netlify-cms-byd\\.pages\\.dev$/.test(message.origin) ||
/^https:\\/\\/[-_\\w]+\\.starknet-netlify-cms\\.pages\\.dev$/.test(message.origin)
);
Expand Down
4 changes: 2 additions & 2 deletions workspaces/netlify-cms-auth/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface Env {
OAUTH_GITHUB_CLIENT_ID: string
OAUTH_GITHUB_CLIENT_SECRET: string
OAUTH_GITHUB_CLIENT_ID: string;
OAUTH_GITHUB_CLIENT_SECRET: string;
}
2 changes: 2 additions & 0 deletions workspaces/netlify-cms/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export default function App() {
backend: {
...CMSConfig.backend,
branch,
base_url:
import.meta.env.VITE_BACKEND_AUTH_URL || CMSConfig.backend.base_url,
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion workspaces/website/src/components/Button/ButtonStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const outline = defineStyle({
borderColor: "grey.morning",
_dark: {
color: "selected.100"
}
},
},
_active: {
bg: "bg.200",
Expand Down

0 comments on commit 78bf840

Please sign in to comment.