Skip to content

Commit

Permalink
Update to be able to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
timkim committed Sep 27, 2024
1 parent 2af4218 commit 4c731fd
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 41 deletions.
78 changes: 39 additions & 39 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
description: "Clean cache (yes|no)"
required: true
default: "no"
preBuilt:
description: "Site is pre-built (yes|no)"
required: true
default: "no"
excludeSubfolder:
description: "Exclude a subfolder from deletion"
required: false
Expand All @@ -30,6 +34,7 @@ jobs:
deploy_prod: ${{ contains(github.event.inputs.env, 'prod') }}
deploy_dev: ${{ contains(github.event.inputs.env, 'dev') }}
clean_cache: ${{ contains(github.event.inputs.clean, 'yes') }}
pre_built: ${{ contains(github.event.inputs.preBuilt, 'yes') }}
path_prefix: ${{ steps.get_path_prefix.outputs.path_prefix }}
branch_short_ref: ${{ steps.get_branch.outputs.branch }}
exclude_subfolder: ${{ github.event.inputs.excludeSubfolder }}
Expand Down Expand Up @@ -57,6 +62,7 @@ jobs:
- run: echo "Deploy to dev - ${{ needs.set-state.outputs.deploy_dev }}"
- run: echo "Deploy to prod - ${{ needs.set-state.outputs.deploy_prod }}"
- run: echo "Clean cache - ${{ needs.set-state.outputs.clean_cache }}"
- run: echo "Pre-built - ${{ needs.set-state.outputs.pre_built }}"
- run: echo "Repository org - ${{ github.event.repository.owner.login }}"
- run: echo "Repository name - ${{ github.event.repository.name }}"
- run: echo "Repository branch - ${{ needs.set-state.outputs.branch_short_ref }}"
Expand Down Expand Up @@ -84,39 +90,36 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3

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

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

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

- name: Gatsby Cache
uses: actions/cache@v4
- name: Install Dependencies
uses: borales/actions-yarn@v3
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
with:
path: |
public
.cache
key: ${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-${{ github.run_id }}
restore-keys: |
${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-
cmd: install
- name: Clean Cache
if: needs.set-state.outputs.clean_cache == 'true'
uses: borales/actions-yarn@v3
with:
cmd: clean

- name: Build site
uses: borales/actions-yarn@v4
if: needs.set-state.outputs.pre_built == 'false'
uses: borales/actions-yarn@v3
with:
cmd: build
env:
Expand Down Expand Up @@ -144,10 +147,9 @@ jobs:
GATSBY_ALGOLIA_INDEX_ENV_PREFIX: ${{ secrets.AIO_ALGOLIA_INDEX_ENV_PREFIX }}
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
GATSBY_SITE_DOMAIN_URL: https://developer-stage.adobe.com
GATSBY_TEMPLATE_ID: ${{ secrets.AIO_IMS_DEV_TEMPLATE_ID }}
GATSBY_PRODUCT_NAME: "Adobe Express Embed SDK"
NODE_OPTIONS: "--max-old-space-size=81920"

GATSBY_TEMPLATE_ID: ${{ secrets.AIO_IMS_DEV_TEMPLATE_ID }}
GATSBY_PRODUCT_NAME: 'Adobe Express Embed SDK'
NODE_OPTIONS: "--max_old_space_size=20140"
- name: Deploy
uses: AdobeDocs/static-website-deploy@master
with:
Expand Down Expand Up @@ -186,28 +188,25 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

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

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

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

- name: Gatsby Cache
uses: actions/cache@v4
- name: Install Dependencies
uses: borales/actions-yarn@v3
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
with:
path: |
public
.cache
key: ${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-${{ github.run_id }}
restore-keys: |
${{ needs.set-state.outputs.branch_short_ref }}-gatsby-cache-
cmd: install

- name: Clean Cache
if: needs.set-state.outputs.clean_cache == 'true'
Expand All @@ -216,7 +215,8 @@ jobs:
cmd: clean

- name: Build site
uses: borales/actions-yarn@v4
if: needs.set-state.outputs.pre_built == 'false'
uses: borales/actions-yarn@v3
with:
cmd: build
env:
Expand Down Expand Up @@ -247,9 +247,9 @@ jobs:
GATSBY_ALGOLIA_INDEX_ENV_PREFIX: ${{ secrets.AIO_ALGOLIA_INDEX_ENV_PREFIX }}
GATSBY_FEDS_PRIVACY_ID: ${{ secrets.AIO_FEDS_PRIVACY_ID }}
GATSBY_SITE_DOMAIN_URL: https://developer.adobe.com
GATSBY_TEMPLATE_ID: ${{ secrets.AIO_IMS_PROD_TEMPLATE_ID }}
GATSBY_TEMPLATE_ID: ${{ secrets.AIO_IMS_PROD_TEMPLATE_ID }}
GATSBY_PRODUCT_NAME: Adobe Express Embed SDK
NODE_OPTIONS: "--max-old-space-size=81920"
NODE_OPTIONS: "--max_old_space_size=20140"
- name: Deploy
uses: AdobeDocs/static-website-deploy@master
with:
Expand All @@ -263,4 +263,4 @@ jobs:
uses: AdobeDocs/gatsby-fastly-purge-action@master
with:
fastly-token: ${{ secrets.AIO_FASTLY_TOKEN }}
fastly-url: "${{ secrets.AIO_FASTLY_PROD_URL }}${{ needs.set-state.outputs.path_prefix }}"
fastly-url: "${{ secrets.AIO_FASTLY_PROD_URL }}${{ needs.set-state.outputs.path_prefix }}"
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ yarn-error.log
# gatsby files
.env
.cache
public

# cypress
cypress/videos
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"start:prefix": "gatsby build --prefix-paths && gatsby serve --prefix-paths",
"dev": "gatsby develop",
"dev:https": "gatsby develop --https --host localhost.corp.adobe.com --port 9000",
"localBuild": "gatsby clean && gatsby build --prefix-paths",
"build": "gatsby build",
"build:incremental": "GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true gatsby build --log-pages",
"serve": "gatsby serve",
Expand All @@ -41,4 +42,4 @@
"remark-cli": "^12.0.1",
"remark-validate-links": "^13.0.1"
}
}
}

0 comments on commit 4c731fd

Please sign in to comment.