-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2221 from Urigo/chore/restore-algolia-workflows
chore(ci): restore algolia workflows
- Loading branch information
Showing
2 changed files
with
114 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Algolia Integrity | ||
on: | ||
pull_request: | ||
paths: | ||
- 'website/**' | ||
jobs: | ||
algolia-records-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Fetch | ||
run: git fetch origin master | ||
- name: Use Node 18 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
- name: Install Dependencies | ||
run: yarn --ignore-engines | ||
|
||
- name: Build Packages | ||
run: yarn build | ||
|
||
- name: Algolia generate | ||
run: yarn workspace website algolia-sync | ||
env: | ||
ALGOLIA_DRY_RUN: true | ||
SITE_URL: https://www.graphql-modules.com/ | ||
|
||
- name: Format | ||
run: yarn format | ||
|
||
- name: Compare | ||
run: git diff origin/${{ github.base_ref }}.. -- website/algolia-lockfile.json | ||
|
||
- name: Diff to file | ||
if: always() | ||
id: diff_result | ||
run: | | ||
OUTPUT=$(git diff origin/${{ github.base_ref }}.. -- website/algolia-lockfile.json) | ||
OUTPUT="${OUTPUT//'%'/'%25'}" | ||
OUTPUT="${OUTPUT//$'\n'/'%0A'}" | ||
OUTPUT="${OUTPUT//$'\r'/'%0D'}" | ||
echo "::set-output name=result::$OUTPUT" | ||
- name: Publish a message | ||
if: always() && contains(steps.diff_result.outputs.result, 'diff') | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
message: | | ||
```diff | ||
${{ steps.diff_result.outputs.result }} | ||
``` |
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,58 @@ | ||
name: Algolia Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
algolia-push-records: | ||
name: Push new records if changes | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'yarn' | ||
|
||
- name: Install Dependencies | ||
run: yarn | ||
|
||
- name: Build Packages | ||
run: yarn build | ||
|
||
- name: Algolia push | ||
run: yarn workspace website algolia-sync | ||
env: | ||
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }} | ||
ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }} | ||
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }} | ||
SITE_URL: https://www.graphql-modules.com/ | ||
|
||
- name: Format | ||
run: yarn format | ||
|
||
- name: Compare | ||
run: git diff website/algolia-lockfile.json | ||
|
||
- name: Diff to file | ||
if: always() | ||
id: diff_result | ||
run: | | ||
OUTPUT=$(git diff website/algolia-lockfile.json) | ||
OUTPUT="${OUTPUT//'%'/'%25'}" | ||
OUTPUT="${OUTPUT//$'\n'/'%0A'}" | ||
OUTPUT="${OUTPUT//$'\r'/'%0D'}" | ||
echo "::set-output name=result::$OUTPUT" | ||
- name: Commit algolia-lockfile.json | ||
if: always() && contains(steps.diff_result.outputs.result, 'diff') | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
commit: website/algolia-lockfile.json | ||
message: Update algolia-lockfile.json | ||
default_author: github_actions |
6892035
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
graphql-modules – ./
graphql-modules.vercel.app
www.graphql-modules.com
graphql-modules.com
graphql-modules-theguild.vercel.app
graphql-modules-git-master-theguild.vercel.app