Skip to content

Commit 20e7c5f

Browse files
authored
Fix and update workflows with a build step (AdobeDocs#80)
* COMDOX-866: Fix and update workflows with a build step * update scripts
1 parent 6f1add2 commit 20e7c5f

File tree

6 files changed

+201
-188
lines changed

6 files changed

+201
-188
lines changed

.github/workflows/github-pages.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,27 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout
9-
uses: actions/checkout@v3
10-
- name: Yarn Install
11-
uses: bahmutov/npm-install@v1
12-
- name: Build
13-
run: |
14-
yarn build
9+
uses: actions/checkout@v4
10+
11+
- name: Setup Node v16
12+
uses: actions/setup-node@v3
13+
with:
14+
node-version-file: '.nvmrc'
15+
cache: 'yarn'
16+
cache-dependency-path: 'yarn.lock'
17+
18+
- name: Enable Corepack for Yarn
19+
run: corepack enable
20+
21+
- name: Install Dependencies
22+
run: yarn install
23+
env:
24+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
25+
26+
- name: Build site
27+
run: yarn build
1528
env:
29+
NODE_OPTIONS: "--max-old-space-size=8192"
1630
PREFIX_PATHS: true # works like --prefix-paths flag for 'gatsby build'
1731
PATH_PREFIX: ${{ github.event.repository.name }}
1832
ADOBE_LAUNCH_SRC: ${{ secrets.AIO_ADOBE_LAUNCH_SRC }}
@@ -35,4 +49,4 @@ jobs:
3549
- name: GH Pages URL
3650
id: gh-pages-url
3751
run: |
38-
echo "View GH-Pages: $(https://adobedocs.github.io/${{ github.event.repository.name }})"
52+
echo "View GH-Pages: $(https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }})"

.github/workflows/index.yml

+21-6
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,28 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
23-
- name: Yarn Install
24-
uses: bahmutov/npm-install@v1
25-
- name: Build
26-
run: |
27-
yarn build
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node v16
25+
uses: actions/setup-node@v3
26+
with:
27+
node-version-file: '.nvmrc'
28+
cache: 'yarn'
29+
cache-dependency-path: 'yarn.lock'
30+
31+
- name: Enable Corepack for Yarn
32+
run: corepack enable
33+
34+
- name: Install Dependencies
35+
run: yarn install
2836
env:
37+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
38+
39+
- name: Build site
40+
run: yarn build
41+
42+
env:
43+
NODE_OPTIONS: "--max_old_space_size=8192"
2944
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'
3045
REPO_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3146
REPO_OWNER: ${{ github.repository_owner }}

.github/workflows/publish.yml

+13-20
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
branch_short_ref: ${{ steps.get_branch.outputs.branch }}
1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@v4
1616

1717
- name: Get pathPrefix
1818
uses: actions/github-script@v6
@@ -56,30 +56,25 @@ jobs:
5656
runs-on: ubuntu-latest
5757
steps:
5858
- name: Checkout
59-
uses: actions/checkout@v3
59+
uses: actions/checkout@v4
6060

61-
- name: Setup Node v16 for Yarn v3
61+
- name: Setup Node v16
6262
uses: actions/setup-node@v3
6363
with:
64-
node-version: '16.15.0' # Current LTS version
65-
66-
- name: Enable Corepack for Yarn v3
64+
node-version-file: '.nvmrc'
65+
cache: 'yarn'
66+
cache-dependency-path: 'yarn.lock'
67+
68+
- name: Enable Corepack for Yarn
6769
run: corepack enable
68-
69-
- name: Install Yarn v3
70-
uses: borales/actions-yarn@v3
71-
with:
72-
cmd: set version stable
73-
70+
7471
- name: Install Dependencies
75-
uses: borales/actions-yarn@v3
72+
run: yarn install
7673
env:
7774
YARN_ENABLE_IMMUTABLE_INSTALLS: false
78-
with:
79-
cmd: install
80-
75+
8176
- name: Gatsby Cache
82-
uses: actions/cache@v2
77+
uses: actions/cache@v3.3.2
8378
with:
8479
path: |
8580
public
@@ -89,9 +84,7 @@ jobs:
8984
${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-
9085
9186
- name: Build site
92-
uses: borales/actions-yarn@v3
93-
with:
94-
cmd: build
87+
run: yarn build
9588
env:
9689
NODE_OPTIONS: "--max_old_space_size=8192"
9790
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'

0 commit comments

Comments
 (0)