chore(viewer sandbox): use CircleCI to publish to Cloudflare pages (#2216)

This commit is contained in:
Iain Sproat
2024-04-19 15:35:35 +01:00
committed by GitHub
parent 2c19c621f5
commit a01bb0ca58
2 changed files with 63 additions and 0 deletions
+54
View File
@@ -305,6 +305,18 @@ workflows:
- test-frontend-2
- test-viewer
- publish-cloudflare-pages:
filters:
tags:
only: *filters-tag
branches:
ignore: /.*/
context:
- cloudflare-pages-edit
requires:
- test-ui-components
- test-viewer
jobs:
get-version:
docker: &docker-base-image
@@ -982,3 +994,45 @@ jobs:
- run:
name: Update Helm Documentation
command: ./.circleci/update_helm_documentation.sh
publish-cloudflare-pages:
docker: *docker-node-image
working_directory: *work-dir
steps:
- checkout
- restore_cache:
name: Restore Yarn Package Cache
keys:
- yarn-packages-server-{{ checksum "yarn.lock" }}
- run:
name: Install Cloudflare Pages CLI
command: npm install -g wrangler && wrangler --version
- run:
name: Install Dependencies
command: yarn
- run:
name: Install Dependencies v2 (.node files missing bug)
command: yarn
- save_cache:
name: Save Yarn Package Cache
key: yarn-packages-server-{{ checksum "yarn.lock" }}
paths:
- .yarn/cache
- .yarn/unplugged
- run:
name: Build public packages
command: yarn build:public
- run:
name: Lint everything
command: yarn lint
working_directory: 'packages/viewer-sandbox'
- run:
name: Publish to Cloudflare Pages
command: ./.circleci/publish_cloudflare_pages.sh
environment:
CLOUDFLARE_PAGES_PROJECT_NAME: viewer
CLOUDFLARE_PAGES_DIST_DIR: ./packages/viewer-sandbox/dist
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eo pipefail
GIT_ROOT=$( git rev-parse --show-toplevel )
CLOUDFLARE_PAGES_PROJECT_NAME="${CLOUDFLARE_PAGES_PROJECT_NAME:-"viewer"}"
CLOUDFLARE_PAGES_DIST_DIR="${CLOUDFLARE_PAGES_DIST_DIR:-"${GIT_ROOT}/packages/viewer-sandbox/dist"}"
wrangler pages publish "${GIT_ROOT}/${CLOUDFLARE_PAGES_DIST_DIR}" --project-name="${CLOUDFLARE_PAGES_PROJECT_NAME}"