Refactor feedstock dir into repos #360
Workflow file for this run
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
name: Catalog | |
on: | |
pull_request: | |
branches: | |
permissions: | |
contents: write | |
pull-requests: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
generate-and-validate: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: set up conda environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ci/environment.yaml | |
init-shell: >- | |
bash | |
cache-environment: true | |
cache-downloads: true | |
post-cleanup: "all" | |
- name: Validate Feedstocks and Generate Catalog | |
run: | | |
leap-catalog generate --path catalog/input.yaml --output catalog/ | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: consolidated-web-catalog.json | |
path: catalog/output/consolidated-web-catalog.json | |
update: | |
needs: generate-and-validate | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
environment: | |
name: ${{ github.event.pull_request.number }} | |
url: ${{ format('https://staging-leap-data-catalog.vercel.app/?catalog=https://raw.githubusercontent.com/{0}/{1}/catalog/output/consolidated-web-catalog.json', github.event.pull_request.head.repo.full_name, github.head_ref) }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Pull Remote Changes | |
run: | | |
git pull origin ${{ github.event.pull_request.head.ref }} --rebase --autostash | |
- name: set up conda environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ci/environment.yaml | |
init-shell: >- | |
bash | |
cache-environment: true | |
cache-downloads: true | |
post-cleanup: "all" | |
- uses: actions/download-artifact@v4 | |
with: | |
name: consolidated-web-catalog.json | |
path: catalog/output | |
- name: Commit and Push | |
run: | | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
pre-commit install | |
git add catalog/output/consolidated-web-catalog.json | |
# run pre-commit and return 0 to avoid failing the job | |
pre-commit run || true | |
git add catalog/output/consolidated-web-catalog.json || true | |
git commit -m "Auto-update consolidated-web-catalog.json" || true | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
# ssh: true | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.event.pull_request.head.repo.full_name }} | |
branch: ${{ github.event.pull_request.head.ref }} |