Skip to content

Commit 1b8f408

Browse files
committed
chore: use latest theme && enable indexing on deploy
1 parent e55a8e5 commit 1b8f408

File tree

4 files changed

+3485
-209
lines changed

4 files changed

+3485
-209
lines changed
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Search Indexing
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
mode:
7+
description: 'Type of indexing. "index" to push to Algolia, "console" for dry run.'
8+
required: true
9+
default: "index"
10+
type: choice
11+
options:
12+
- console
13+
- index
14+
15+
jobs:
16+
build-and-index:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node v18 for Yarn v4
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: "18.19.0" # Current LTS version
26+
27+
- name: Enable Corepack for Yarn
28+
run: corepack enable
29+
30+
- name: Install Dependencies
31+
run: yarn install
32+
env:
33+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
34+
35+
- name: Build site
36+
run: yarn build
37+
38+
env:
39+
NODE_OPTIONS: "--max_old_space_size=8192"
40+
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'
41+
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
REPO_OWNER: ${{ github.repository_owner }}
43+
REPO_NAME: ${{ github.event.repository.name }}
44+
REPO_BRANCH: ${{ github.ref_name }}
45+
GATSBY_ALGOLIA_APPLICATION_ID: ${{ secrets.AIO_ALGOLIA_APPLICATION_ID }}
46+
GATSBY_ALGOLIA_SEARCH_API_KEY: ${{ secrets.AIO_ALGOLIA_SEARCH_API_KEY }}
47+
ALGOLIA_WRITE_API_KEY: ${{ secrets.AIO_ALGOLIA_WRITE_API_KEY }}
48+
ALGOLIA_INDEXATION_MODE: ${{ github.event.inputs.mode || 'index' }}
49+
GATSBY_ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME || github.event.repository.name }}
50+
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
51+
GATSBY_SITE_DOMAIN_URL: https://developer.adobe.com

.github/workflows/deploy.yml

+31-23
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@ on:
44
workflow_dispatch:
55
inputs:
66
env:
7-
description: 'Deploy to (dev|prod|dev prod)'
7+
description: "Deploy to (dev|prod|dev prod)"
88
required: true
9-
default: 'dev'
9+
default: "dev"
1010
clean:
11-
description: 'Clean cache (yes|no)'
11+
description: "Clean cache (yes|no)"
1212
required: true
13-
default: 'no'
13+
default: "no"
1414
excludeSubfolder:
15-
description: 'Exclude a subfolder from deletion'
15+
description: "Exclude a subfolder from deletion"
1616
required: false
17-
default: ''
17+
default: ""
18+
index-mode:
19+
description: 'Type of indexing. "index" to push to Algolia, "console" for dry run.'
20+
required: true
21+
default: "index"
22+
type: choice
23+
options:
24+
- console
25+
- index
1826
jobs:
1927
set-state:
2028
runs-on: ubuntu-latest
@@ -39,7 +47,7 @@ jobs:
3947
result-encoding: string
4048
- name: Get branch name
4149
shell: bash
42-
run: echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
50+
run: echo "branch=${GITHUB_REF#refs/heads/}" >> "$GITHUB_OUTPUT"
4351
id: get_branch
4452

4553
echo-state:
@@ -81,7 +89,7 @@ jobs:
8189
- name: Setup Node v16 for Yarn v3
8290
uses: actions/setup-node@v3
8391
with:
84-
node-version: '16.15.0' # Current LTS version
92+
node-version: "16.15.0" # Current LTS version
8593

8694
- name: Enable Corepack for Yarn v3
8795
run: corepack enable
@@ -123,7 +131,7 @@ jobs:
123131
PATH_PREFIX: ${{ needs.set-state.outputs.path_prefix }}
124132
GATSBY_ADOBE_LAUNCH_SRC: ${{ secrets.AIO_ADOBE_LAUNCH_DEV_SRC }}
125133
GATSBY_ADDITIONAL_ADOBE_ANALYTICS_ACCOUNTS: ${{ secrets.AIO_REPORT_SUITE_DEV}}
126-
GATSBY_ADOBE_ANALYTICS_ENV: 'dev'
134+
GATSBY_ADOBE_ANALYTICS_ENV: "dev"
127135
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128136
REPO_OWNER: ${{ github.event.repository.owner.login }}
129137
REPO_NAME: ${{ github.event.repository.name }}
@@ -142,22 +150,22 @@ jobs:
142150
GATSBY_ALGOLIA_SEARCH_INDEX: ${{ secrets.AIO_ALGOLIA_SEARCH_INDEX }}
143151
GATSBY_ALGOLIA_INDEX_ENV_PREFIX: ${{ secrets.AIO_ALGOLIA_INDEX_ENV_PREFIX }}
144152
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
153+
GATSBY_SITE_DOMAIN_URL: https://developer-stage.adobe.com
145154
NODE_OPTIONS: "--max_old_space_size=8192"
146-
147155
- name: Deploy
148156
uses: AdobeDocs/static-website-deploy@master
149157
with:
150-
enabled-static-website: 'true'
151-
source: 'public'
158+
enabled-static-website: "true"
159+
source: "public"
152160
target: ${{ needs.set-state.outputs.path_prefix }}
153161
connection-string: ${{ secrets.AIO_AZURE_DEV_CONNECTION_STRING }}
154-
remove-existing-files: 'true'
162+
remove-existing-files: "true"
155163
exclude-subfolder: ${{ needs.set-state.outputs.exclude_subfolder }}
156164
- name: Purge Fastly Cache
157165
uses: AdobeDocs/gatsby-fastly-purge-action@master
158166
with:
159167
fastly-token: ${{ secrets.AIO_FASTLY_TOKEN }}
160-
fastly-url: '${{ secrets.AIO_FASTLY_DEV_URL}}${{ needs.set-state.outputs.path_prefix }}'
168+
fastly-url: "${{ secrets.AIO_FASTLY_DEV_URL}}${{ needs.set-state.outputs.path_prefix }}"
161169

162170
pre-build-production:
163171
needs: [set-state]
@@ -185,7 +193,7 @@ jobs:
185193
- name: Setup Node v16 for Yarn v3
186194
uses: actions/setup-node@v3
187195
with:
188-
node-version: '16.15.0' # Current LTS version
196+
node-version: "16.15.0" # Current LTS version
189197

190198
- name: Enable Corepack for Yarn v3
191199
run: corepack enable
@@ -227,7 +235,7 @@ jobs:
227235
PATH_PREFIX: ${{ needs.set-state.outputs.path_prefix }}
228236
GATSBY_ADOBE_LAUNCH_SRC: ${{ secrets.AIO_ADOBE_LAUNCH_PROD_SRC }}
229237
GATSBY_ADDITIONAL_ADOBE_ANALYTICS_ACCOUNTS: ${{ secrets.AIO_REPORT_SUITE_PROD }}
230-
GATSBY_ADOBE_ANALYTICS_ENV: 'production'
238+
GATSBY_ADOBE_ANALYTICS_ENV: "production"
231239
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
232240
REPO_OWNER: ${{ github.event.repository.owner.login }}
233241
REPO_NAME: ${{ github.event.repository.name }}
@@ -243,25 +251,25 @@ jobs:
243251
GATSBY_ALGOLIA_APP_ID: ${{ secrets.AIO_ALGOLIA_APP_ID }}
244252
GATSBY_ALGOLIA_API_KEY: ${{ secrets.AIO_ALGOLIA_API_KEY }}
245253
ALGOLIA_WRITE_API_KEY: ${{ secrets.AIO_ALGOLIA_WRITE_API_KEY }}
246-
ALGOLIA_INDEXATION_MODE: ${{ secrets.AIO_ALGOLIA_INDEXATION_MODE }}
247-
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME || github.event.repository.name }}
254+
ALGOLIA_INDEXATION_MODE: ${{ github.event.inputs.index-mode || 'index' }}
255+
GATSBY_ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME || github.event.repository.name }}
248256
GATSBY_ALGOLIA_INDEX_ALL_SRC: ${{ secrets.AIO_ALGOLIA_INDEX_ALL_SRC }}
249257
GATSBY_ALGOLIA_SEARCH_INDEX: ${{ secrets.AIO_ALGOLIA_SEARCH_INDEX }}
250258
GATSBY_ALGOLIA_INDEX_ENV_PREFIX: ${{ secrets.AIO_ALGOLIA_INDEX_ENV_PREFIX }}
251259
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
260+
GATSBY_SITE_DOMAIN_URL: https://developer.adobe.com
252261
NODE_OPTIONS: "--max_old_space_size=8192"
253-
254262
- name: Deploy
255263
uses: AdobeDocs/static-website-deploy@master
256264
with:
257-
enabled-static-website: 'true'
258-
source: 'public'
265+
enabled-static-website: "true"
266+
source: "public"
259267
target: ${{ needs.set-state.outputs.path_prefix }}
260268
connection-string: ${{ secrets.AIO_AZURE_PROD_CONNECTION_STRING }}
261-
remove-existing-files: 'true'
269+
remove-existing-files: "true"
262270
exclude-subfolder: ${{ needs.set-state.outputs.exclude_subfolder }}
263271
- name: Purge Fastly Cache
264272
uses: AdobeDocs/gatsby-fastly-purge-action@master
265273
with:
266274
fastly-token: ${{ secrets.AIO_FASTLY_TOKEN }}
267-
fastly-url: '${{ secrets.AIO_FASTLY_PROD_URL }}${{ needs.set-state.outputs.path_prefix }}'
275+
fastly-url: "${{ secrets.AIO_FASTLY_PROD_URL }}${{ needs.set-state.outputs.path_prefix }}"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"url": "https://github.com/icaraps"
1313
},
1414
"dependencies": {
15-
"@adobe/gatsby-theme-aio": "^4.9.13",
15+
"@adobe/gatsby-theme-aio": "^4.14.4",
1616
"gatsby": "4.22.0",
1717
"react": "^17.0.2",
1818
"react-dom": "^17.0.2"

0 commit comments

Comments
 (0)