Skip to content

Commit

Permalink
Merge pull request #2 from eodash/preview-concept
Browse files Browse the repository at this point in the history
add catalog preview concept
  • Loading branch information
santilland authored Sep 13, 2024
2 parents 1791884 + 5061fda commit d6e9289
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 10 deletions.
17 changes: 8 additions & 9 deletions .github/workflows/build_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ jobs:
permissions:
contents: write
pages: write
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.10
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- name: Install dependencies
run: |
pip install -U pip
Expand All @@ -38,11 +39,9 @@ jobs:
SH_CLIENT_SECRET: ${{ secrets.SH_CLIENT_SECRET }}
run: eodash_catalog
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
force_orphan: true


folder: ./build
branch: gh-pages
clean-exclude: pr-preview
force: false
55 changes: 55 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# .github/workflows/preview.yml
# This is a basic workflow takes care of building and deploying
# catalog when creating merge request

name: Deploy PR previews

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed # pr-preview-action will do cleanup here, but build steps can be skipped

# do not allow running multiple of pipelines for this PR in parallel
concurrency: preview-${{ github.ref }}

jobs:
deploy-preview:
runs-on: ubuntu-22.04
permissions:
contents: write
pages: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- if: github.event.action != 'closed'
name: Install dependencies
run: |
pip install -U pip
pip install -r requirements.txt
- if: github.event.action != 'closed' && (github.event.pull_request.body == 'all' || github.event.pull_request.body == '')
name: Build all collections
env:
SH_INSTANCE_ID: ${{ secrets.SH_INSTANCE_ID }}
SH_CLIENT_ID: ${{ secrets.SH_CLIENT_ID }}
SH_CLIENT_SECRET: ${{ secrets.SH_CLIENT_SECRET }}
run: eodash_catalog
- if: github.event.action != 'closed' && (github.event.pull_request.body != 'all' && github.event.pull_request.body != '')
name: Build only specified collections from PR comment text
env:
SH_INSTANCE_ID: ${{ secrets.SH_INSTANCE_ID }}
SH_CLIENT_ID: ${{ secrets.SH_CLIENT_ID }}
SH_CLIENT_SECRET: ${{ secrets.SH_CLIENT_SECRET }}
run: |
eodash_catalog ${{ github.event.pull_request.body }}
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# catalog-template
Template for creating eodash catalog repository
Template for creating eodash catalog repository.

## How-to
You can create a new repository using the "use this template" button.
Expand Down

0 comments on commit d6e9289

Please sign in to comment.