Yes, if your custodian offers investments. Options are similar to an IRA: mutual funds, stocks, bonds and CDs. You choose how, or whether, to invest.
Investment growth inside an HSA is tax-free, and withdrawals for qualified medical expenses are tax-free too.
Some custodians require you to keep a minimum cash balance before you can invest. Like any investment, HSA investments can lose value, so many people keep enough in cash to cover their deductible.