-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): refactor workflows (#5977)
- Loading branch information
Showing
20 changed files
with
273 additions
and
256 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,36 +1,40 @@ | ||
name: PR Documentation [synchronize] | ||
name: Documentation | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- synchronize | ||
- opened | ||
- reopened | ||
paths: | ||
- "documentation/**" | ||
|
||
jobs: | ||
documentation: | ||
if: github.repository_owner == 'refinedev' | ||
typos: | ||
name: Check spelling using typos | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: ${{ github.ref }}-pr-doc | ||
group: docs-typos-${{ github.ref }} | ||
cancel-in-progress: true | ||
steps: | ||
- name: Check out code. | ||
uses: actions/checkout@v4 | ||
- name: typos | ||
id: check_for_typos | ||
uses: crate-ci/typos@master | ||
with: | ||
config: ./typos.toml | ||
deploy_documentation: | ||
name: Documentation Deploy | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: docs-deploy-${{ github.ref }} | ||
cancel-in-progress: true | ||
strategy: | ||
matrix: | ||
node-version: [18.x] | ||
|
||
name: Deploy Documentation Preview | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "pnpm" | ||
node-version: 18 | ||
cache: pnpm | ||
- name: Add key to allow access to repository | ||
env: | ||
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | ||
|
@@ -44,30 +48,41 @@ jobs: | |
HostName github.com | ||
IdentityFile ~/.ssh/id_rsa | ||
EOT | ||
- name: Install Package Dependencies | ||
- name: Install & build dependencies | ||
run: pnpm install | ||
- name: Install dependencies (Docs) | ||
run: | | ||
cd documentation | ||
pnpm install | ||
- name: Install Doc Dependencies | ||
- name: Release to GitHub Pages | ||
if: github.ref == 'refs/heads/master' | ||
env: | ||
USE_SSH: true | ||
GIT_USER: pankod-bot | ||
NODE_ENV: production | ||
NODE_OPTIONS: "--max_old_space_size=4096" | ||
run: | | ||
cd documentation | ||
pnpm install | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "pankod-bot" | ||
LIVE_PREVIEW_URL=https://next.live-previews.refine.dev/preview pnpm run deploy | ||
- name: Wait for Netlify Deploy (Live Previews) | ||
uses: probablyup/[email protected] | ||
id: waitForDeployment | ||
if: github.ref != 'refs/heads/master' | ||
continue-on-error: true | ||
with: | ||
site_id: ${{ secrets.NETLIFY_PREVIEW_SITE_ID }} | ||
max_timeout: 1200 | ||
env: | ||
NETLIFY_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
- name: output test | ||
run: | | ||
echo ${{ steps.waitForDeployment.outputs.url }} | ||
- name: Build Documentation | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
cd documentation | ||
LIVE_PREVIEW_URL=${{ steps.waitForDeployment.outputs.url }}/preview pnpm build | ||
- name: Deploy to Netlify | ||
if: github.ref != 'refs/heads/master' | ||
id: netlify-deploy | ||
uses: nwtgck/[email protected] | ||
with: | ||
|
@@ -82,5 +97,5 @@ jobs: | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | ||
timeout-minutes: 15 | ||
- name: Check Existing Links in Documentation | ||
if: steps.netlify-deploy.outputs.deploy-url | ||
run: DEPLOY_URL=${{ steps.netlify-deploy.outputs.deploy-url }} SITEMAP_URL=https://refine.dev/sitemap.xml node ./.github/workflows/check-existing-doc-links.js | ||
if: ${{ github.ref != 'refs/heads/master' && steps.netlify-deploy.outputs.deploy-url }} | ||
run: DEPLOY_URL=${{ steps.netlify-deploy.outputs.deploy-url }} SITEMAP_URL=https://refine.dev/sitemap.xml node ./.github/workflows/scripts/check-existing-doc-links.js |
Oops, something went wrong.