serverless-nextjs-github-ci-cd icon indicating copy to clipboard operation
serverless-nextjs-github-ci-cd copied to clipboard

Only sync .serverless state if files exist, without having to comment out the step

Open WarcraftYax opened this issue 3 years ago • 0 comments

You can get around the awkward "comment out this step for first run" if you use a bash if statement to check if files exist at that path or not before trying to sync from it:

if [[ $(aws s3 ls ${{ env.SERVERLESS_STATE_BUCKET_PATH }} | head) ]]; then aws s3 sync ${{ env.SERVERLESS_STATE_BUCKET_PATH }} .serverless --delete; fi

WarcraftYax avatar Aug 11 '21 15:08 WarcraftYax