serverless-nextjs-github-ci-cd
serverless-nextjs-github-ci-cd copied to clipboard
Only sync .serverless state if files exist, without having to comment out the step
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