diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index 34fd6c8c..00000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,111 +0,0 @@
-version: 2.1
-
-references:
- restore_repo: &restore_repo
- restore_cache:
- keys:
- - v0-repo-{{ .Branch }}-{{ .Revision }}
- - v0-repo-{{ .Branch }}
- - v0-repo
-
- restore_dependencies: &restore_dependencies
- restore_cache:
- keys:
- - v0-dependencies-{{ checksum "package.json"}}
- - v0-dependencies
-
- restore_build: &restore_build
- restore_cache:
- keys:
- - v0-build-{{ .Branch }}-{{ .Revision }}
-
-
-jobs:
- validate:
- working_directory: ~/stac
- docker:
- - image: cimg/node:16.14
- steps:
- - checkout
- - save_cache:
- key: v0-repo-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/stac
- - run:
- name: install
- command: npm install
- - save_cache:
- key: v0-dependencies-{{ checksum "package.json"}}
- paths:
- - ~/stac/node_modules
- - run:
- name: validate
- command: npm run check
- build:
- working_directory: ~/stac
- docker:
- - image: cimg/node:16.14
- steps:
- - *restore_repo
- - *restore_dependencies
- - run:
- name: build openapi
- command: npm run build-openapi
- - save_cache:
- key: v0-build-{{ .Branch }}-{{ .Revision }}
- paths:
- - ~/stac/build
- publish:
- working_directory: ~/stac
- docker:
- - image: cimg/node:16.14
- steps:
- - *restore_repo
- - *restore_dependencies
- - *restore_build
- - add_ssh_keys
- - run:
- name: publish
- command: |
- ssh-keyscan github.com >> ~/.ssh/known_hosts
- npm run publish-openapi -- $CIRCLE_TAG
- check-core-changes:
- working_directory: ~/stac
- docker:
- - image: cimg/node:16.14
- steps:
- - *restore_repo
- - *restore_dependencies
- - run:
- name: check-core-changes
- command: npm run check-stac-spec-changes --compare-to=<< pipeline.git.base_revision >>
-
-workflows:
- version: 2
- ci:
- jobs:
- - validate:
- filters:
- tags:
- only: /^v.*/
- - build:
- requires:
- - validate
- filters:
- tags:
- only: /^v.*/
- - check-core-changes:
- requires:
- - validate
- filters:
- tags:
- only: /^v.*/
- - publish:
- requires:
- - build
- filters:
- tags:
- only: /^v.*/
- branches:
- # Only main branch, not PRs
- only: main
\ No newline at end of file
diff --git a/.circleci/.spectral-fragments.yml b/.github/.spectral-fragments.yml
similarity index 100%
rename from .circleci/.spectral-fragments.yml
rename to .github/.spectral-fragments.yml
diff --git a/.circleci/.spectral.yml b/.github/.spectral.yml
similarity index 100%
rename from .circleci/.spectral.yml
rename to .github/.spectral.yml
diff --git a/.circleci/build-openapi.sh b/.github/build-openapi.sh
similarity index 100%
rename from .circleci/build-openapi.sh
rename to .github/build-openapi.sh
diff --git a/.circleci/publish.js b/.github/publish.js
similarity index 53%
rename from .circleci/publish.js
rename to .github/publish.js
index 629a1ac6..38ae0bad 100644
--- a/.circleci/publish.js
+++ b/.github/publish.js
@@ -6,7 +6,7 @@ if (args.length && args[0].trim().length > 0) {
tag = args[0];
}
-ghpages.publish('build/', {
+const options = {
src: '**',
dest: tag,
message: 'Publish JSON Schemas [ci skip]',
@@ -14,7 +14,15 @@ ghpages.publish('build/', {
name: 'STAC CI',
email: 'ci@stacspec.org'
}
-}, error => {
+};
+
+// Use GITHUB_TOKEN for authentication in CI environment
+if (process.env.GITHUB_TOKEN) {
+ const repo = process.env.GITHUB_REPOSITORY || 'radiantearth/stac-api-spec';
+ options.repo = `https://x-access-token:${process.env.GITHUB_TOKEN}@github.com/${repo}.git`;
+}
+
+ghpages.publish('build/', options, error => {
console.error(error ? error : 'Deployed to gh-pages');
process.exit(error ? 1 : 0);
});
\ No newline at end of file
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 00000000..a0fec8a3
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,90 @@
+name: Publish
+
+on:
+ push:
+ tags:
+ - 'v*'
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '16.14'
+ cache: 'npm'
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Run validation
+ run: npm run check
+
+ build:
+ runs-on: ubuntu-latest
+ needs: validate
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'npm'
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Build OpenAPI
+ run: npm run build-openapi
+
+ - name: Upload build artifacts
+ uses: actions/upload-artifact@v4
+ with:
+ name: build
+ path: build/
+
+ publish:
+ runs-on: ubuntu-latest
+ needs: build
+ permissions:
+ contents: write
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'npm'
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Download build artifacts
+ uses: actions/download-artifact@v4
+ with:
+ name: build
+ path: build/
+
+ - name: Configure git
+ run: |
+ git config --global user.name "STAC CI"
+ git config --global user.email "ci@stacspec.org"
+
+ - name: Publish to gh-pages
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ if [[ "${{ github.ref }}" == refs/tags/* ]]; then
+ TAG="${{ github.ref_name }}"
+ else
+ TAG="main"
+ fi
+ npm run publish-openapi -- $TAG
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 00000000..5ac8070c
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,67 @@
+name: Test
+
+on:
+ push:
+ branches:
+ - main
+ pull_request:
+
+jobs:
+ validate:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'npm'
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Run validation
+ run: npm run check
+
+ build:
+ runs-on: ubuntu-latest
+ needs: validate
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'npm'
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Build OpenAPI
+ run: npm run build-openapi
+
+ check-core-changes:
+ runs-on: ubuntu-latest
+ needs: validate
+ if: github.event_name == 'pull_request'
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'npm'
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Check STAC spec changes
+ run: npm run check-stac-spec-changes --compare-to=${{ github.event.pull_request.base.sha }}
diff --git a/build/redoc_index.html b/build/redoc_index.html
index 9ba1d22a..262749ad 100644
--- a/build/redoc_index.html
+++ b/build/redoc_index.html
@@ -26,7 +26,7 @@
pathInMiddlePanel='true'
hideDownloadButton='true'
>
-
+