# create the job called deploy
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
stage: deploy
# uses the latest alpine CT image because that's what I like, it's lightweight, fast, simple
image: alpine
# only runs on push event on branch "main"
# docs: https://docs.gitlab.com/ee/ci/yaml/index.html#onlyrefs--exceptrefs
only:
- pushes
- main
# 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/
environment:
SRC_DIR: .
DEST_DIR: climatepro_theme
HUBSPOT_PORTAL_ID: 123456
HUBSPOT_PERSONAL_ACCESS_KEY: the-personall-access-key
# 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 :}
script:
# 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