Skip to content

Commit 1f7232a

Browse files
authored
chore: use latest theme && enable indexing on deploy (#472)
1 parent c6a2e79 commit 1f7232a

File tree

4 files changed

+3539
-188
lines changed

4 files changed

+3539
-188
lines changed
Lines changed: 51 additions & 0 deletions
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

Lines changed: 31 additions & 27 deletions
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: '2021, 2023'
17+
default: "2021, 2023"
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,24 +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

146155
- name: Deploy
147156
uses: AdobeDocs/static-website-deploy@master
148157
with:
149-
enabled-static-website: 'true'
150-
source: 'public'
158+
enabled-static-website: "true"
159+
source: "public"
151160
target: ${{ needs.set-state.outputs.path_prefix }}
152161
connection-string: ${{ secrets.AIO_AZURE_DEV_CONNECTION_STRING }}
153-
remove-existing-files: 'true'
162+
remove-existing-files: "true"
154163
exclude-subfolder: ${{ needs.set-state.outputs.exclude_subfolder }}
155-
- name: Delay purge
156-
run: sleep 60s
157-
shell: bash
158164
- name: Purge Fastly Cache
159165
uses: AdobeDocs/gatsby-fastly-purge-action@master
160166
with:
161167
fastly-token: ${{ secrets.AIO_FASTLY_TOKEN }}
162-
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 }}"
163169

164170
pre-build-production:
165171
needs: [set-state]
@@ -187,7 +193,7 @@ jobs:
187193
- name: Setup Node v16 for Yarn v3
188194
uses: actions/setup-node@v3
189195
with:
190-
node-version: '16.15.0' # Current LTS version
196+
node-version: "16.15.0" # Current LTS version
191197

192198
- name: Enable Corepack for Yarn v3
193199
run: corepack enable
@@ -229,7 +235,7 @@ jobs:
229235
PATH_PREFIX: ${{ needs.set-state.outputs.path_prefix }}
230236
GATSBY_ADOBE_LAUNCH_SRC: ${{ secrets.AIO_ADOBE_LAUNCH_PROD_SRC }}
231237
GATSBY_ADDITIONAL_ADOBE_ANALYTICS_ACCOUNTS: ${{ secrets.AIO_REPORT_SUITE_PROD }}
232-
GATSBY_ADOBE_ANALYTICS_ENV: 'production'
238+
GATSBY_ADOBE_ANALYTICS_ENV: "production"
233239
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
234240
REPO_OWNER: ${{ github.event.repository.owner.login }}
235241
REPO_NAME: ${{ github.event.repository.name }}
@@ -245,26 +251,24 @@ jobs:
245251
GATSBY_ALGOLIA_APP_ID: ${{ secrets.AIO_ALGOLIA_APP_ID }}
246252
GATSBY_ALGOLIA_API_KEY: ${{ secrets.AIO_ALGOLIA_API_KEY }}
247253
ALGOLIA_WRITE_API_KEY: ${{ secrets.AIO_ALGOLIA_WRITE_API_KEY }}
248-
ALGOLIA_INDEXATION_MODE: ${{ secrets.AIO_ALGOLIA_INDEXATION_MODE }}
249-
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 }}
250256
GATSBY_ALGOLIA_INDEX_ALL_SRC: ${{ secrets.AIO_ALGOLIA_INDEX_ALL_SRC }}
251257
GATSBY_ALGOLIA_SEARCH_INDEX: ${{ secrets.AIO_ALGOLIA_SEARCH_INDEX }}
252258
GATSBY_ALGOLIA_INDEX_ENV_PREFIX: ${{ secrets.AIO_ALGOLIA_INDEX_ENV_PREFIX }}
253259
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
260+
GATSBY_SITE_DOMAIN_URL: https://developer.adobe.com
254261
- name: Deploy
255262
uses: AdobeDocs/static-website-deploy@master
256263
with:
257-
enabled-static-website: 'true'
258-
source: 'public'
264+
enabled-static-website: "true"
265+
source: "public"
259266
target: ${{ needs.set-state.outputs.path_prefix }}
260267
connection-string: ${{ secrets.AIO_AZURE_PROD_CONNECTION_STRING }}
261-
remove-existing-files: 'true'
268+
remove-existing-files: "true"
262269
exclude-subfolder: ${{ needs.set-state.outputs.exclude_subfolder }}
263-
- name: Delay purge
264-
run: sleep 60s
265-
shell: bash
266270
- name: Purge Fastly Cache
267271
uses: AdobeDocs/gatsby-fastly-purge-action@master
268272
with:
269273
fastly-token: ${{ secrets.AIO_FASTLY_TOKEN }}
270-
fastly-url: '${{ secrets.AIO_FASTLY_PROD_URL }}${{ needs.set-state.outputs.path_prefix }}'
274+
fastly-url: "${{ secrets.AIO_FASTLY_PROD_URL }}${{ needs.set-state.outputs.path_prefix }}"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://github.com/AdobeDocs/uxp-photoshop"
99
},
1010
"dependencies": {
11-
"@adobe/gatsby-theme-aio": "4.9.10",
11+
"@adobe/gatsby-theme-aio": "^4.14.4",
1212
"gatsby": "4.22.0",
1313
"react": "^17.0.2",
1414
"react-dom": "^17.0.2",

0 commit comments

Comments
 (0)