Last active
May 20, 2024 13:12
-
-
Save sortofsleepy/ecdcd56f67193a2e3606fe7692b1edcd to your computer and use it in GitHub Desktop.
Gitlab CI deploy to cloudflare example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:latest | |
cache: | |
paths: | |
- node_modules/ | |
stages: | |
- build | |
compile: | |
stage: build | |
# this ensures the pipeline will only run on the default branch. | |
rules: | |
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH | |
variables: | |
CLOUDFLARE_API_TOKEN: <variable name> | |
CLOUDFLARE_ACCOUNT_ID: <variable name> | |
script: | |
- npm install | |
- npm run build | |
- npx wrangler pages deploy | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a sample config for deploying to cloudflare pages with Gitlab's CI system. Though this is Gitlab specific, the general ideas should largely be transferable to other systems
This assumes project specifics re: Cloudflare are in a wrangler.toml