Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] Use image processor #78

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 31 additions & 0 deletions .github/workflows/image-processing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Image processing

on: push

jobs:
process:
runs-on: ubuntu-latest
steps:
# Checkout repo
- name: Checkout data
uses: actions/checkout@v2
# Setup node (including yarn)
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
env:
GITHUB_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn run process-images
env:
GITHUB_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
S3_ENDPOINT: ${{ secrets.IMAGE_STORE_S3_ENDPOINT }}
S3_REGION: ${{ secrets.IMAGE_STORE_S3_REGION }}
S3_ACCESS_KEY: ${{ secrets.IMAGE_STORE_S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.IMAGE_STORE_S3_SECRET_KEY }}
ORIGINALS_BUCKET: ${{ secrets.IMAGE_STORE_ORIGINALS_BUCKET }}
PROCESSED_BUCKET: ${{ secrets.IMAGE_STORE_PROCESSED_BUCKET }}
34 changes: 34 additions & 0 deletions .github/workflows/image-uploading.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Upload images to ImageKit

on: push

jobs:
process:
runs-on: ubuntu-latest
steps:
# Checkout repo
- name: Checkout data
uses: actions/checkout@v2
# Setup node (including yarn)
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- run: yarn
env:
GITHUB_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: yarn run upload-images
env:
IMAGEKIT_PUBKEY: ${{ secrets.IMAGEKIT_PUBKEY }},
IMAGEKIT_PRIVKEY: ${{ secrets.IMAGEKIT_PRIVKEY }},
IMAGEKIT_URL: ${{ secrets.IMAGEKIT_URL }},
GITHUB_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
S3_ENDPOINT: ${{ secrets.IMAGE_STORE_S3_ENDPOINT }}
S3_REGION: ${{ secrets.IMAGE_STORE_S3_REGION }}
S3_ACCESS_KEY: ${{ secrets.IMAGE_STORE_S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.IMAGE_STORE_S3_SECRET_KEY }}
ORIGINALS_BUCKET: ${{ secrets.IMAGE_STORE_ORIGINALS_BUCKET }}
PROCESSED_BUCKET: ${{ secrets.IMAGE_STORE_PROCESSED_BUCKET }}
2 changes: 2 additions & 0 deletions .github/workflows/site-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
# Concatenate branch specific URLs
SITE_URL: https://data-preview-${{ env.CI_REF_NAME_SLUG }}--clever-murdock-f2e04c.netlify.app
API_URL: https://data-preview-${{ env.CI_REF_NAME_SLUG }}--clever-murdock-f2e04c.netlify.app/api
IMAGES_URL: ${{ secrets.IMAGES_URL }}
NO_IMAGES: true
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.API_NETLIFY_SITE_ID }}
- run: yarn
Expand Down
3 changes: 2 additions & 1 deletion data/images/sizes.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"medium": 768,
"large": 1026,
"xlarge": 1500
}
},
"formats": ["[original]", "webp", "avif"]
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
"private": false,
"scripts": {
"build": "processAudioxideData",
"dev": "yarn && processAudioxideData && npx http-server dist -p 8888 --cors -c-1"
"dev": "yarn && processAudioxideData && npx http-server dist -p 8888 --cors -c-1",
"process-images": "processAudioxideImages",
"upload-images": "processAudioxideUploadImages"
},
"dependencies": {
"@audioxide/data-processor": "^0.14.1",
"@audioxide/data-processor": "^0.15.17",
"@babel/core": "^7.12.10",
"flexsearch": "^0.6.32",
"node-fetch": "^2.6.1"
Expand Down
Loading