This Action takes a file list from the checked out (LFS skipped) repository and iterates over pointer files, using their contents to discover the "original" asset URL using the LFS API.
It then invokes a Lambda function on each key, with a set of destination parameters to output print and preview resolution files. Running this as a Github action allows visibility of the process results, vs triggering the Lambda from S3 activity when files are synced during an Action.
A further advantage is reduced IO during the build process as a full checkout of LFS resources can be skipped.
REQUIRED The product slug to use as a subdirectory when uploading processed files to their destination.
REQUIRED S3 bucket for destination images.
The Lambda function to be invoked.
REQUIRED The current repository, used for LFS authentication. Use the
github.repository
context value.
REQUIRED Git LFS API path for image discovery
Project directory where source images are located. Default static-assets
.
Internally the resolver looks within this for an images
folder.
Default 300
Default 72
uses: Lostmyname/lfs-pointer-resolver@v3
with:
muse_product_slug: 'my-product-slug/commit_sha'
aws_s3_bucket: 'my-s3-bucket'
lambda_target: 'my-lambda-function'
repository: ${{ github.repository }}
lfs_discovery_endpoint: 'https://github.com/foo/bar.git/info/lfs/objects/batch'
print_image_dpi: 300
preview_image_dpi: 72
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'eu-west-1'
It is recommended that a Github Action is pre-compiled with it's dependencies
and node_modules
is not checked in.
Follow Github's instructions on building and pushing
new versions of this Action using @vercel/ncc
as a build tool.
An alias for the build command is provided as yarn build
.