from pathlib import Path
import gzip


def gzip_archive(directory: str, glob_pattern: str) -> None:
    """GZip files, deletes, and places results in nested '/archive' subdirectory"""
    filepath = Path(directory)
    archivepath = Path(directory) / "archive"
    files = [file for file in filepath.glob(glob_pattern) if file.is_file()]
    if not files:
        return None

    archivepath.mkdir(parents=True, exist_ok=True)

    for file in files:
        with gzip.open(archivepath / f"{file.name}.gzip", mode="wb") as archive:
            with file.open(mode="rb") as infile:
                archive.write(infile.read())