-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CMS and Crowdin integration with optimized workflows and refac…
…tored project structure
- Loading branch information
Showing
488 changed files
with
9,304 additions
and
18,708 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Algolia Action | ||
|
||
on: | ||
push: | ||
paths: | ||
- "_data/**" | ||
- "workspaces/cms-*/**" | ||
- ".github/workflows/algolia.yml" | ||
branches: | ||
- dev | ||
- production | ||
|
||
jobs: | ||
update-index: | ||
runs-on: ubuntu-22.04 | ||
environment: "dev-algolia-index" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.yarn/cache | ||
.yarn/install-state.gz | ||
.eslintcache | ||
**/tsconfig.tsbuildinfo | ||
**/.types/** | ||
**/.types-*/** | ||
key: build-cache-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
build-cache- | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Update Algolia search index | ||
run: yarn workspace @starknet-io/cms-scripts update-algolia-index | ||
env: | ||
ALGOLIA_INDEX: ${{ github.ref_name }} | ||
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | ||
ALGOLIA_SEARCH_API_KEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }} | ||
ALGOLIA_WRITE_API_KEY: ${{ secrets.ALGOLIA_WRITE_API_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.yarn/cache | ||
.yarn/install-state.gz | ||
.eslintcache | ||
**/tsconfig.tsbuildinfo | ||
**/.types/** | ||
**/.types-*/** | ||
key: build-cache-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
build-cache- | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Restore Crowdin Cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: _crowdin | ||
key: crowdin-cache-dev | ||
|
||
- name: Update dynamic data | ||
run: yarn workspace @starknet-io/cms-scripts update-dynamic-data | ||
|
||
- name: Build project | ||
run: yarn exec next build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,65 @@ | ||
name: Crowdin Action | ||
|
||
on: | ||
- workflow_dispatch | ||
workflow_dispatch: | ||
|
||
concurrency: crowdin-dev | ||
|
||
jobs: | ||
synchronize-with-crowdin: | ||
name: Synchronize with Crowdin | ||
environment: "dev-crowdin" | ||
|
||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.yarn/cache | ||
.yarn/install-state.gz | ||
.eslintcache | ||
**/tsconfig.tsbuildinfo | ||
**/.types/** | ||
**/.types-*/** | ||
key: build-cache-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
build-cache- | ||
# - uses: actions/setup-node@v3 | ||
# with: | ||
# node-version: 18 | ||
# cache: yarn | ||
# - run: yarn | ||
# - run: yarn workspace content-onedge-workspace pre-crowdin | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: crowdin action | ||
uses: crowdin/github-action@v1 | ||
- name: Restore Crowdin Cache | ||
uses: actions/cache/restore@v3 | ||
with: | ||
upload_sources: true | ||
upload_translations: false | ||
download_translations: true | ||
# download_language: 'de' | ||
localization_branch_name: ${{ github.ref_name }}_l10n | ||
crowdin_branch_name: dev | ||
create_pull_request: true | ||
pull_request_title: "New Crowdin Translations" | ||
pull_request_body: "New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)" | ||
base_url: "https://starkware.crowdin.com" | ||
path: _crowdin | ||
key: crowdin-cache-${{ github.ref_name }} | ||
|
||
- name: Run pre-Crowdin script for file preparation | ||
run: yarn workspace @starknet-io/cms-scripts pre-crowdin | ||
|
||
- name: Upload source files to Crowdin project | ||
run: yarn crowdin upload -b ${{ github.ref_name }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
|
||
- name: Download approved translations from Crowdin | ||
run: yarn crowdin download -b ${{ github.ref_name }} --export-only-approved --skip-untranslated-strings | ||
env: | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
|
||
- name: Save Crowdin Cache | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: _crowdin | ||
key: crowdin-cache-${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build and Deploy Netlify CMS Auth | ||
|
||
on: | ||
push: | ||
branches: | ||
- deploy/netlify-cms-auth | ||
|
||
jobs: | ||
build_and_deploy: | ||
name: Build and Deploy | ||
environment: "netlify-cms-auth" | ||
permissions: | ||
contents: read | ||
deployments: write | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.yarn/cache | ||
.yarn/install-state.gz | ||
.eslintcache | ||
**/tsconfig.tsbuildinfo | ||
**/.types/** | ||
**/.types-*/** | ||
key: build-cache-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
build-cache- | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Publish | ||
uses: cloudflare/[email protected] | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
workingDirectory: workspaces/netlify-cms-auth | ||
command: publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Build and Deploy Netlify CMS | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build and Deploy | ||
environment: "netlify-cms" | ||
permissions: | ||
contents: read | ||
deployments: write | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
.yarn/cache | ||
.yarn/install-state.gz | ||
.eslintcache | ||
**/tsconfig.tsbuildinfo | ||
**/.types/** | ||
**/.types-*/** | ||
key: build-cache-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
build-cache- | ||
- name: Install dependencies | ||
run: yarn | ||
|
||
- name: Build Netlify CMS | ||
run: yarn workspace @starknet-io/netlify-cms build | ||
env: | ||
VITE_GIT_BRANCH_NAME: ${{ github.ref_name }} | ||
# TODO update this once CORS updates land on prod | ||
VITE_API_BASE_URL: https://starknet-website-git-tsotne-wip2-yuki-labs.vercel.app/api | ||
|
||
- name: Deploy Netlify CMS | ||
uses: cloudflare/pages-action@1 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
projectName: starknet-netlify-cms | ||
directory: workspaces/netlify-cms/dist | ||
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
name: Open PR to merge dev into production | ||
|
||
on: | ||
push: | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.