Skip to content

Commit

Permalink
Merge pull request #223 from AdobeDocs/ds_fix-workflows
Browse files Browse the repository at this point in the history
Fix and update workflows with a build step
  • Loading branch information
dshevtsov authored Dec 13, 2023
2 parents bf40e81 + 7e51e18 commit f0e3f2e
Show file tree
Hide file tree
Showing 4 changed files with 181 additions and 190 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Yarn Install
uses: bahmutov/npm-install@v1
- name: Build
run: |
yarn build
uses: actions/checkout@v4

- name: Setup Node v16
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Enable Corepack for Yarn
run: corepack enable

- name: Install Dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false

- name: Build site
run: yarn build
env:
NODE_OPTIONS: "--max-old-space-size=8192"
PREFIX_PATHS: true # works like --prefix-paths flag for 'gatsby build'
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,27 @@ jobs:
build-and-index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node v16 for Yarn v3
- name: Setup Node v16
uses: actions/setup-node@v3
with:
node-version: '16.15.0' # Current LTS version
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Enable Corepack for Yarn v3
- name: Enable Corepack for Yarn
run: corepack enable

- name: Install Yarn v3
uses: borales/actions-yarn@v3
with:
cmd: set version stable

- name: Install dependencies
uses: borales/actions-yarn@v3
with:
cmd: install
- name: Install Dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false

- name: Build site
uses: borales/actions-yarn@v3
with:
cmd: build
run: yarn build

env:
NODE_OPTIONS: "--max_old_space_size=8192"
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'
Expand Down
33 changes: 13 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
branch_short_ref: ${{ steps.get_branch.outputs.branch }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get pathPrefix
uses: actions/github-script@v6
Expand Down Expand Up @@ -56,30 +56,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node v16 for Yarn v3
- name: Setup Node v16
uses: actions/setup-node@v3
with:
node-version: '16.15.0' # Current LTS version

- name: Enable Corepack for Yarn v3
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Enable Corepack for Yarn
run: corepack enable

- name: Install Yarn v3
uses: borales/actions-yarn@v3
with:
cmd: set version stable


- name: Install Dependencies
uses: borales/actions-yarn@v3
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
with:
cmd: install


- name: Gatsby Cache
uses: actions/cache@v2
uses: actions/cache@v3.3.2
with:
path: |
public
Expand All @@ -89,9 +84,7 @@ jobs:
${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-
- name: Build site
uses: borales/actions-yarn@v3
with:
cmd: build
run: yarn build
env:
NODE_OPTIONS: "--max_old_space_size=8192"
PREFIX_PATHS: true # equivalent to --prefix-paths flag for 'gatsby build'
Expand Down
Loading

0 comments on commit f0e3f2e

Please sign in to comment.