Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 0 additions & 111 deletions .circleci/config.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 10 additions & 2 deletions .circleci/publish.js → .github/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ 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]',
user: {
name: 'STAC CI',
email: '[email protected]'
}
}, 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);
});
90 changes: 90 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"

- 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
67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion build/redoc_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
pathInMiddlePanel='true'
hideDownloadButton='true'
></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
<script src="https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js"> </script>
</body>

</html>
Loading