Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
63ecae8
Prerender services
TsayAdobe Apr 21, 2025
9d32a26
Read EdgeKV and Inject the prerendered snippet
TsayAdobe Apr 21, 2025
b2e4f48
Handle prerender element
TsayAdobe Apr 21, 2025
dffe8ef
Fix ESlint
TsayAdobe Apr 21, 2025
ea889d0
Add developement tools and README
TsayAdobe Apr 21, 2025
4480a9e
Merge branch 'stage' into MWPW-170391
TsayAdobe Apr 22, 2025
6d59bb9
Merge pull request #1117 from adobecom/MWPW-170391
TsayAdobe Apr 22, 2025
ea02e65
Merge branch 'stage' into MWPW-170393
TsayAdobe Apr 22, 2025
9406b34
Merge pull request #1118 from adobecom/MWPW-170393
TsayAdobe Apr 23, 2025
892773f
Merge branch 'stage' into MWPW-170394X
TsayAdobe Apr 23, 2025
e97464e
Merge pull request #1119 from adobecom/MWPW-170394X
TsayAdobe Apr 23, 2025
f92eed7
Fix typo in the path
TsayAdobe Apr 23, 2025
49d8c4a
Merge pull request #1129 from adobecom/prerenderfix
TsayAdobe Apr 23, 2025
989e4ac
Fix EW deploy script
TsayAdobe Apr 23, 2025
039ccf2
Merge branch 'stage' into prerenderfix
TsayAdobe Apr 23, 2025
9a796bf
Merge pull request #1130 from adobecom/prerenderfix
TsayAdobe Apr 23, 2025
f95d45c
Fix workflows
TsayAdobe Apr 23, 2025
e0738cc
Merge branch 'stage' into prerenderfix
TsayAdobe Apr 23, 2025
c670a5c
Merge pull request #1131 from adobecom/prerenderfix
TsayAdobe Apr 23, 2025
feac348
Fix workflows
TsayAdobe Apr 23, 2025
6e49e97
Merge branch 'stage' into prerenderfix
TsayAdobe Apr 23, 2025
168430c
Merge pull request #1132 from adobecom/prerenderfix
TsayAdobe Apr 23, 2025
55f17dd
SVGs for batch 2a
Blainegunn Apr 23, 2025
51efb52
Merge pull request #1133 from adobecom/MWPW-172025
Blainegunn Apr 23, 2025
5a78218
MWPW-172023
Blainegunn Apr 23, 2025
115b7f2
Fix for tablet view
TsayAdobe Apr 23, 2025
4b2e2f1
Merge branch 'stage' into prerenderfix
TsayAdobe Apr 23, 2025
3cd02b5
Merge pull request #1135 from adobecom/prerenderfix
TsayAdobe Apr 23, 2025
e8a9858
rm unneeded value
Blainegunn Apr 24, 2025
4c970d7
Merge branch 'stage' into MWPW-172023
Blainegunn Apr 24, 2025
daac737
Merge pull request #1134 from adobecom/MWPW-172023
Blainegunn Apr 24, 2025
92aa028
No prerender for tablets
TsayAdobe Apr 24, 2025
070e5ca
Merge branch 'stage' into prerenderfix
TsayAdobe Apr 24, 2025
6618156
Merge pull request #1138 from adobecom/prerenderfix
TsayAdobe Apr 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/deploy-edgeworker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ jobs:
npm run ewsetbundle ${{ inputs.edgeworker }} "${{ inputs.description }}"
env:
EDGERC: ${{ secrets.AKAMAI_EDGERC }}
EDGEKV_TOKEN_REF: ${{ secrets.EDGEKV_TOKEN_REF }}

- name: Deploy Edge Worker
uses: jdmevo123/akamai-edgeworker-action@1.1
uses: adobecom/akamai-edgeworker-action@1.2
env:
EDGERC: ${{ secrets.AKAMAI_EDGERC }}
WORKER_DIR: edgeworkers/${{ inputs.edgeworker }}
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/prerender-check-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Prerender - Check prerenders - Stage

on:
workflow_dispatch:
inputs:
url_or_gist:
description: 'URL to prerender or GitHub Gist ID containing URLs (one per line)'
required: true
type: string
layout:
description: 'Layout to prerender (For URL input only)'
required: true
type: choice
options:
- desktop
- mobile
hostsHack:
description: 'Hosts File Hack'
required: false
type: string

jobs:
check-prerender:
runs-on: [self-hosted, Linux, X64]

steps:
- name: Hosts file hack
if: inputs.hostsHack != ''
run: |
echo ${{ inputs.hostsHack }} | sudo tee -a /etc/hosts
cat /etc/hosts

- name: Check out repository
uses: actions/checkout@v4
with:
sparse-checkout: |
tools/prerender/screenshot-gist.js
tools/prerender/screenshot.js

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}-${{ runner.os }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts

- name: Process URLs
run: |
if [[ "${{ inputs.url_or_gist }}" =~ ^[0-9a-f]{32}$ ]]; then
# If input looks like a gist ID, use screenshot-gist.js
node tools/prerender/screenshot-gist.js "${{ inputs.url_or_gist }}"
else
# Otherwise treat as a single URL
node tools/prerender/screenshot.js "${{ inputs.url_or_gist }}" --layout ${{ inputs.layout }}
fi
env:
USER_AGENT_SUFFIX: ${{ secrets.USER_AGENT_SUFFIX }}

- name: Upload prerender artifacts
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: prerender-screenshots
path: tools/prerender/*.png

- name: Cleanup hosts file hack
if: inputs.hostsHack != ''
run: |
sudo sed -i "/${{ github.event.inputs.hostsHack }}/d" /etc/hosts
cat /etc/hosts
77 changes: 77 additions & 0 deletions .github/workflows/prerender-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Prerender - Check prerenders

on:
workflow_dispatch:
inputs:
url_or_gist:
description: 'URL to prerender or GitHub Gist ID containing URLs (one per line)'
required: true
type: string
layout:
description: 'Layout to prerender (For URL input only)'
required: true
type: choice
options:
- desktop
- mobile
hostsHack:
description: 'Hosts File Hack'
required: false
type: string

jobs:
check-prerender:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.51.1-noble

steps:
- name: Hosts file hack
if: inputs.hostsHack != ''
run: |
echo ${{ inputs.hostsHack }} | sudo tee -a /etc/hosts
cat /etc/hosts

- name: Check out repository
uses: actions/checkout@v4
with:
sparse-checkout: |
tools/prerender/screenshot-gist.js
tools/prerender/screenshot.js

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}-${{ runner.os }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts

- name: Process URLs
run: |
if [[ "${{ inputs.url_or_gist }}" =~ ^[0-9a-f]{32}$ ]]; then
# If input looks like a gist ID, use screenshot-gist.js
node tools/prerender/screenshot-gist.js "${{ inputs.url_or_gist }}"
else
# Otherwise treat as a single URL
node tools/prerender/screenshot.js "${{ inputs.url_or_gist }}" --layout ${{ inputs.layout }}
fi
env:
USER_AGENT_SUFFIX: ${{ secrets.USER_AGENT_SUFFIX }}

- name: Upload prerender artifacts
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: prerender-screenshots
path: tools/prerender/*.png

- name: Cleanup hosts file hack
if: inputs.hostsHack != ''
run: |
sudo sed -i "/${{ github.event.inputs.hostsHack }}/d" /etc/hosts
cat /etc/hosts
83 changes: 83 additions & 0 deletions .github/workflows/prerender-create-bulk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Prerender - Create N prerenders

on:
workflow_dispatch:
inputs:
url_or_gist:
description: 'URL to prerender or GitHub Gist ID containing URLs (one per line)'
required: true
type: string
layout:
description: 'Layout to prerender (For URL input only)'
required: true
type: choice
options:
- desktop
- mobile
network:
description: 'Network to write to'
required: true
type: choice
options:
- staging
- production
namespace:
description: 'Namespace to write to'
required: true
type: choice
options:
- stage
- prod
group:
description: 'Group to write to'
required: true
type: string
default: 'frictionless'

jobs:
create-prerenders:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.51.1-noble

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
sparse-checkout: |
tools/prerender/prerender.js
tools/prerender/prerender-gist.js

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}-${{ runner.os }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts

- name: Setup Akamai Authentication
env:
EDGERC: ${{ secrets.EDGERC_EDGEKV }}
run: |
echo "${EDGERC}" > ~/.edgerc

- name: Process gist and create prerenders
run: |
if [[ "${{ inputs.url_or_gist }}" =~ ^[0-9a-f]{32}$ ]]; then
# If input looks like a gist ID, use prerender-gist.js
node tools/prerender/prerender-gist.js "${{ inputs.url_or_gist }}" "${{ inputs.network }}" "${{ inputs.namespace }}" "${{ inputs.group }}"
else
# Otherwise treat as a single URL
node tools/prerender/prerender.js "${{ inputs.url_or_gist }}" --layout ${{ inputs.layout }} --network ${{ inputs.network }} --namespace ${{ inputs.namespace }} --group ${{ inputs.group }} --edgekv
fi
shell: bash
env:
USER_AGENT_SUFFIX: ${{ secrets.USER_AGENT_SUFFIX }}

- name: Cleanup Akamai credentials
if: always()
run: rm -f ~/.edgerc
80 changes: 80 additions & 0 deletions .github/workflows/prerender-create-stage-bulk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Prerender - Create N prerenders - Stage

on:
workflow_dispatch:
inputs:
url_or_gist:
description: 'URL to prerender or GitHub Gist ID containing URLs (one per line)'
required: true
type: string
layout:
description: 'Layout to prerender (For URL input only)'
required: true
type: choice
options:
- desktop
- mobile
network:
description: 'Network to write to'
required: true
type: choice
options:
- staging
- production
namespace:
description: 'Namespace to write to'
required: true
type: choice
options:
- stage
- prod
group:
description: 'Group to write to'
required: true
type: string
default: 'frictionless'

jobs:
create-prerender:
runs-on: [self-hosted, Linux, X64]

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
sparse-checkout: |
tools/prerender/prerender-gist.js
tools/prerender/prerender.js

- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}-${{ runner.os }}

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci --ignore-scripts

- name: Setup Akamai Authentication
env:
EDGERC: ${{ secrets.EDGERC_EDGEKV }}
run: |
echo "${EDGERC}" > ~/.edgerc

- name: Process URLs
run: |
if [[ "${{ inputs.url_or_gist }}" =~ ^[0-9a-f]{32}$ ]]; then
# If input looks like a gist ID, use prerender-gist.js
node tools/prerender/prerender-gist.js "${{ inputs.url_or_gist }}" "${{ inputs.network }}" "${{ inputs.namespace }}" "${{ inputs.group }}"
else
# Otherwise treat as a single URL
node tools/prerender/prerender.js "${{ inputs.url_or_gist }}" --layout ${{ inputs.layout }} --network ${{ inputs.network }} --namespace ${{ inputs.namespace }} --group ${{ inputs.group }} --edgekv
fi
env:
USER_AGENT_SUFFIX: ${{ secrets.USER_AGENT_SUFFIX }}

- name: Cleanup Akamai credentials
if: always()
run: rm -f ~/.edgerc
Loading
Loading