Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add CI workflow #135

Merged
merged 4 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
verify_files:
name: Verify Files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install Packages
run: npm ci
- name: Shape libs-data.json
run: npm run fetch-data
- name: Lint Files
run: npm run lint
- name: Typecheck
run: npm run typecheck
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
UIKIT_TARGET_BRANCH: 'main'
DATE_COMPONENTS_TARGET_BRANCH: 'main'
# Deploy
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ UIKIT_TARGET_BRANCH="your-branch" # default main, target branch for pulling docu

COMPONENTS_TARGET_BRANCH="your-branch" # default main, target branch for pulling documentation from components

DATE_COMPONENTS_TARGET_BRANCH="your-branch" # default main, target branch for pulling documentation from date-components

GITHUB_PROFILE="your profile" # default gravity-ui, target profile for pulling documentation from components
```
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
});

if (!options.isServer) {
config.resolve.fallback.fs = false;

Check warning on line 60 in next.config.js

View workflow job for this annotation

GitHub Actions / Verify Files

Assignment to property of function parameter 'config'
}

return config;
Expand All @@ -73,6 +73,7 @@
env: {
UIKIT_TARGET_BRANCH: process.env.UIKIT_TARGET_BRANCH,
COMPONENTS_TARGET_BRANCH: process.env.COMPONENTS_TARGET_BRANCH,
DATE_COMPONENTS_TARGET_BRANCH: process.env.DATE_COMPONENTS_TARGET_BRANCH,
},
experimental: {
esmExternals: 'loose',
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"lint:prettier": "prettier --check '**/*.md'",
"lint": "npm run lint:js && npm run lint:styles && npm run lint:prettier",
"predeploy": "npm run build && npm run export",
"deploy": "echo 'gravity-ui.com' > ./build/CNAME && gh-pages -d build"
"deploy": "echo 'gravity-ui.com' > ./build/CNAME && gh-pages -d build",
"typecheck": "tsc --noEmit"
},
"browserslist": {
"production": [
Expand Down
2 changes: 2 additions & 0 deletions src/content/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import {Repos} from '../../types/common';

const uikitTargetBranch = process.env.UIKIT_TARGET_BRANCH || TARGET_BRANCH;
const componentsTargetBranch = process.env.COMPONENTS_TARGET_BRANCH || TARGET_BRANCH;
const dateComponentsTargetBranch = process.env.DATE_COMPONENTS_TARGET_BRANCH || TARGET_BRANCH;
const githubTargetprofile = process.env.GITHUB_PROFILE || TARGET_PROFILE;

const TARGET_REPOS_BRANCHES = {
[Repos.Uikit]: uikitTargetBranch,
[Repos.Components]: componentsTargetBranch,
[Repos.DateComponents]: dateComponentsTargetBranch,
};

export type GetterProps = {componentName: string; repoName: Repos};
Expand Down
Loading