There are two ways to achieve this:
One is to set ignorecase, then the pattern regex will ignore the case. Yet, this solution is poor if you are writing a script that may need to be reused by someone.
A better solution is to use the \c (ignore case) \C (do not ignore case) modifiers in the regex. This command:
g/\cpattern/z#.1|echo "================================"
Will always ignore the case of pattern no matter what you have set ignorecase to.
And this command:
g/\Cpattern/z#.1|echo "================================"
Will always perform a case sensitive search for pattern, even if you have ignorecase set to true.
Reference (the forward slash is important):