docs: ensure asset paths update on draft rebuilds (#7355)
This commit is contained in:
parent
b4124a4027
commit
bdcd76d5cd
1 changed files with 23 additions and 3 deletions
26
.github/workflows/deploy-docs-draft.yml
vendored
26
.github/workflows/deploy-docs-draft.yml
vendored
|
|
@ -138,6 +138,25 @@ jobs:
|
||||||
aws configure set aws_secret_access_key ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
|
aws configure set aws_secret_access_key ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
|
||||||
aws configure set region us-west-2
|
aws configure set region us-west-2
|
||||||
|
|
||||||
|
- name: Check for New Assets
|
||||||
|
run: |
|
||||||
|
set -o pipefail
|
||||||
|
echo "Checking for new assets." |& tee -a $GITHUB_WORKSPACE/deploy.log
|
||||||
|
echo "aws s3 sync docs/build/assets/ s3://${{ vars.DOCS_DRAFT_S3_BUCKET_NAME }}/langflow-drafts/${{ steps.extract_branch.outputs.draft_directory }}/assets/ --size-only --dryrun --no-progress" | tee -a $GITHUB_WORKSPACE/deploy.log
|
||||||
|
aws s3 sync docs/build/assets/ "s3://${{ vars.DOCS_DRAFT_S3_BUCKET_NAME }}/langflow-drafts/${{ steps.extract_branch.outputs.draft_directory }}/assets/" --size-only --dryrun --no-progress | tee $GITHUB_WORKSPACE/assets.log
|
||||||
|
|
||||||
|
- name: Determine Standard or Full Publish
|
||||||
|
id: check_full_publish
|
||||||
|
run: |
|
||||||
|
# Determine if a full publish is required because of new assets.
|
||||||
|
if grep -qE '(upload:|delete:)' "$GITHUB_WORKSPACE/assets.log"; then
|
||||||
|
echo "New assets. Perform full publish: true" | tee -a "$GITHUB_WORKSPACE/deploy.log"
|
||||||
|
echo "perform_full_publish=true" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "No new assets. Perform full publish: false" | tee -a "$GITHUB_WORKSPACE/deploy.log"
|
||||||
|
echo "perform_full_publish=false" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Deploy to S3
|
- name: Deploy to S3
|
||||||
if: success()
|
if: success()
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -154,14 +173,15 @@ jobs:
|
||||||
s3_params=(
|
s3_params=(
|
||||||
# Hide upload progress for a cleaner sync log
|
# Hide upload progress for a cleaner sync log
|
||||||
--no-progress
|
--no-progress
|
||||||
# Because the build will produce new timestamps
|
|
||||||
# on each build, sync files based on size.
|
|
||||||
--size-only
|
|
||||||
--delete
|
--delete
|
||||||
--exclude "*"
|
--exclude "*"
|
||||||
--include "${{ steps.extract_branch.outputs.draft_directory }}/*"
|
--include "${{ steps.extract_branch.outputs.draft_directory }}/*"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if [[ "${{ steps.check_full_publish.outputs.perform_full_publish }}" == "false" ]]; then
|
||||||
|
s3_params+=(--size-only)
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Deploying draft to S3." |& tee -a $GITHUB_WORKSPACE/deploy.log
|
echo "Deploying draft to S3." |& tee -a $GITHUB_WORKSPACE/deploy.log
|
||||||
echo "aws s3 sync . s3://${{ vars.DOCS_DRAFT_S3_BUCKET_NAME }}/langflow-drafts ${s3_params[@]}" |& tee -a $GITHUB_WORKSPACE/deploy.log
|
echo "aws s3 sync . s3://${{ vars.DOCS_DRAFT_S3_BUCKET_NAME }}/langflow-drafts ${s3_params[@]}" |& tee -a $GITHUB_WORKSPACE/deploy.log
|
||||||
aws s3 sync . "s3://${{ vars.DOCS_DRAFT_S3_BUCKET_NAME }}/langflow-drafts" "${s3_params[@]}" |& tee -a $GITHUB_WORKSPACE/deploy.log
|
aws s3 sync . "s3://${{ vars.DOCS_DRAFT_S3_BUCKET_NAME }}/langflow-drafts" "${s3_params[@]}" |& tee -a $GITHUB_WORKSPACE/deploy.log
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue