New article (#23) #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy (production) | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup bun.sh environment | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
- name: Cache buns dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.bun/install/cache | |
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} | |
restore-keys: | | |
${{ runner.os }}-bun- | |
- name: Run bun install | |
run: bun install --frozen-lockfile | |
- name: Cache Next.js build cache | |
uses: actions/cache@v4 | |
with: | |
path: apps/static-site/.next/cache | |
key: ${{ runner.os }}-iiif-cache-${{ hashFiles('**/bun.lockb') }}--${{ hashFiles('app/static-site/src/**/*.ts', 'app/static-site/src/**/*.tsx') }} | |
restore-keys: | | |
${{ runner.os }}-iiif-cache-${{ hashFiles('**/bun.lockb') }} | |
- name: IIIF Netlify deploy (production) | |
id: netlify_iiif | |
working-directory: apps/iiif | |
run: | | |
deploy_json=$(npx [email protected] deploy \ | |
--build \ | |
--prod \ | |
--json \ | |
--message="Deploy from GitHub Actions") | |
preview_url=$(echo $deploy_json | jq -r '.deploy_url') | |
echo "preview_url=$preview_url" >> $GITHUB_OUTPUT | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_IIIF_SITE_ID }} | |
IIIF_PREVIEW_URL: https://heritage.tudelft.nl/iiif | |
- name: Static site Netlify deploy (production) | |
id: netlify_static_site | |
run: | | |
deploy_json=$(npx [email protected] deploy \ | |
--build \ | |
--json \ | |
--prod \ | |
--filter=static-site \ | |
--message="Deploy from GitHub Actions") | |
preview_url=$(echo $deploy_json | jq -r '.deploy_url') | |
echo "preview_url=$preview_url" >> $GITHUB_OUTPUT | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
# This is a search-only API key (public) | |
NEXT_PUBLIC_IIIF_URL: https://heritage.tudelft.nl/iiif | |
NEXT_PUBLIC_TYPESENSE_API_KEY: 8EOitKCMTbxUKPZNqUEoQS9M2RGvpkZS | |
NEXT_PUBLIC_TYPESENSE_HOST: 63flhve71t2un5xgp.a1.typesense.net | |
NEXT_PUBLIC_TYPESENSE_PORT: 443 | |
NEXT_PUBLIC_TYPESENSE_PROTOCOL: https | |
NEXT_PUBLIC_TYPESENSE_COLLECTION_NAME: production-manifests | |
- name: Build IIIF Search | |
working-directory: apps/static-site | |
run: | | |
bun run ./typesense-update.ts | |
env: | |
TYPESENSE_API_KEY: ${{ secrets.TYPESENSE_ADMIN_API_KEY }} | |
TYPESENSE_HOST: 63flhve71t2un5xgp.a1.typesense.net | |
TYPESENSE_PORT: 443 | |
TYPESENSE_PROTOCOL: https | |
TYPESENSE_COLLECTION_NAME: production-manifests |