Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
tailwind-crawler/entrypoint.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
65 lines (47 sloc)
1.42 KB
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
#!/bin/sh | |
export WORKSPACE_REPOSITORY="$INPUT_REPOSITORY" | |
export CRAWLER_REPOSITORY="$INPUT_CRAWLER" | |
export OUTPUT_REPOSITORY="$INPUT_OUTPUT" | |
unset INPUT_REPOSITORY | |
# Clone crawler | |
echo "Cloning crawler..." | |
git clone "https://$INPUT_ACTOR:$INPUT_TOKEN@teamhydra.io/$CRAWLER_REPOSITORY.git" /crawler | |
# Install crawler dependencies | |
echo "Installing crawler dependencies..." | |
cd /crawler | |
npm install | |
echo "Setting up git LFS" | |
git lfs install | |
# Clone workspace | |
echo "Cloning workspace..." | |
git clone "https://$INPUT_ACTOR:$INPUT_TOKEN@teamhydra.io/$WORKSPACE_REPOSITORY.git" /workspace | |
# Inject .env from workspace | |
echo "Injecting .env from workspace..." | |
touch /workspace/.env | |
cp /workspace/.env /crawler/.env | |
# Clone output | |
echo "Cloning output..." | |
git clone "https://$INPUT_ACTOR:$INPUT_TOKEN@teamhydra.io/$OUTPUT_REPOSITORY.git" /output | |
# Run crawler | |
echo "Running crawler..." | |
export OUTPUT="/output/$INPUT_OUTPUTFOLDER" | |
export EMAIL="$INPUT_EMAIL" | |
export PASSWORD="$INPUT_PASSWORD" | |
node /crawler/index.mjs | |
# Commit changes | |
echo "Commiting changes..." | |
cd /output | |
rm -rf docs | |
mv preview docs | |
echo "Using LFS for .zip files" | |
git lfs track "*.zip" | |
git add . | |
git commit -m "$INPUT_COMMITMESSAGE" | |
# Push changes | |
echo "Pushing changes..." | |
force_option="" | |
if $INPUT_FORCE; then | |
force_option="--force" | |
fi | |
remote="https://$INPUT_ACTOR:$INPUT_TOKEN@teamhydra.io/$OUTPUT_REPOSITORY.git" | |
git push $remote "HEAD:$INPUT_BRANCH" $force_option && exit 0 |