Reuse published photo variants and deploy the validated build
This commit is contained in:
parent
0afd149382
commit
8dbea46ddb
1 changed files with 226 additions and 29 deletions
|
|
@ -9,6 +9,8 @@ on:
|
|||
|
||||
jobs:
|
||||
validate:
|
||||
env:
|
||||
PHOTO_ASSET_CACHE_URL: https://photos.schmelczer.dev/static/photos/
|
||||
runs-on:
|
||||
${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
|
||||
'renovate/')) && 'renovate' || 'docker' }}
|
||||
|
|
@ -26,7 +28,6 @@ jobs:
|
|||
uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
|
@ -41,11 +42,22 @@ jobs:
|
|||
run: npm run build
|
||||
|
||||
- name: Install Playwright browser
|
||||
run: npx playwright install --with-deps chromium
|
||||
run: npx playwright install --with-deps --only-shell chromium
|
||||
|
||||
- name: End-to-end smoke test
|
||||
env:
|
||||
PLAYWRIGHT_USE_EXISTING_BUILD: '1'
|
||||
run: npm run test:e2e
|
||||
|
||||
- name: Save validated build
|
||||
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && contains(fromJSON('["andras","ruby336688"]'), github.actor) }}
|
||||
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
|
||||
with:
|
||||
name: photos-validated-dist
|
||||
path: dist
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
if:
|
||||
${{ contains(fromJSON('["andras","ruby336688","renovate-bot"]'), github.actor) && (!github.event.pull_request || contains(fromJSON('["andras","ruby336688","renovate-bot"]'),
|
||||
github.event.pull_request.user.login)) }}
|
||||
|
|
@ -54,30 +66,15 @@ jobs:
|
|||
${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref,
|
||||
'renovate/')) && 'renovate' || 'docker' }}
|
||||
needs: validate
|
||||
if:
|
||||
${{ contains(fromJSON('["andras","ruby336688","renovate-bot"]'), github.actor) && (!github.event.pull_request || contains(fromJSON('["andras","ruby336688","renovate-bot"]'),
|
||||
github.event.pull_request.user.login)) && (github.event_name == 'push' && github.ref == 'refs/heads/main') }}
|
||||
# Never cancel an in-flight deploy: rsync --delete must finish or the live
|
||||
# site can be left half-deleted. Newer deploys queue behind this one.
|
||||
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && contains(fromJSON('["andras","ruby336688"]'), github.actor) }}
|
||||
steps:
|
||||
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
|
||||
|
||||
- name: Download validated build
|
||||
uses: https://github.com/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Setup Node
|
||||
uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
name: photos-validated-dist
|
||||
path: dist
|
||||
|
||||
- name: Upload static site artifact 1
|
||||
if: ${{ (true) }}
|
||||
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
|
||||
with:
|
||||
name: pages-deploy-0
|
||||
|
|
|
|||
Loading…
Reference in a new issue