# create the job called deploy
# which is run in the "deploy" stage
# "deploy" stage is one of the pre-defined stages
# docs: https://docs.gitlab.com/ee/ci/yaml/#stages
# uses the latest alpine CT image because that's what I like, it's lightweight, fast, simple
# only runs on push event on branch "main"
# docs: https://docs.gitlab.com/ee/ci/yaml/index.html#onlyrefs--exceptrefs
# We'll define stuff in ENVs here, but you can always use the CI secrets. I'll just put them here so you get the idea
# docs: https://docs.gitlab.com/ee/ci/variables/
# Apparently HubSpot kinda trash because they have nothing for GitLab even tho it's a rather large platform :thonk:
# ref: https://developers.hubspot.com/hs-search-results?term=gitlab
# So yeah... we'll have to go raw with bash :}
# We gonna be using their CLI ...
# ... which is NodeJS-based so we install nodejs and yarn packages and the CLI itself
# ref: https://developers.hubspot.com/docs/cms/developer-reference/local-development-cms-cli
# We'll just replicate something similar to what they did in their GH action definition
# ref: https://github.com/HubSpot/hubspot-cms-deploy-action/blob/main/action.yml
- apk add nodejs yarn
- yarn global add @hubspot/cli
# And now we deploy the thingy
- hs upload "$SRC_DIR" "$DEST_DIR" --use-env
I have not tested this, so I guess just fork the repo, create a testing deployment on hubspot (or however that platform even works) and test it out.
Keep me posted if it worked just fine on the 1st try