code: def zip_and_upload(app_dir, bucket, key, session=None):
      
      if session:
          s3_client = session.client('s3')
      else:
          s3_client = boto3.client('s3')
      transfer = S3Transfer(s3_client)
  
      filedes, temp_file = tempfile.mkstemp()
      os.close(filedes)
      LOGGER.info("staticsite: archiving app at %s to s3://%s/%s",
                  app_dir, bucket, key)
      with zipfile.ZipFile(temp_file, 'w', zipfile.ZIP_DEFLATED) as filehandle:
          with change_dir(app_dir):
              for dirname, _subdirs, files in os.walk('./'):
                  if dirname != './':
                      filehandle.write(dirname)
                  for filename in files:
                      filehandle.write(os.path.join(dirname, filename))
      transfer.upload_file(temp_file, bucket, key)
      os.remove(temp_file)
docs: Zip built static site and upload to S3.