[pre-commit.ci] pre-commit autoupdate (#184) #420
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: Make JSON | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
mkjson: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: setup-yq | |
run: | | |
sudo curl -L "https://github.com/mikefarah/yq/releases/download/v4.28.2/yq_linux_amd64" > /usr/local/bin/yq | |
sudo chmod +x /usr/local/bin/yq | |
- name: convert to json | |
run: | | |
mkdir build | |
touch build/.nojekyll | |
cat packages/**/meta.yaml | |
yq -o=json packages/**/meta.yaml | jq -s . > build/ecosystem.json | |
- name: Upload GitHub Pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: "build" | |
deploy: | |
runs-on: ubuntu-latest | |
needs: mkjson | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
- name: Trigger website build | |
run: | | |
curl -XPOST \ | |
-u "scverse-bot:${{ secrets.BOT_GH_TOKEN }}" \ | |
-H "Accept: application/vnd.github.everest-preview+json" \ | |
-H "Content-Type: application/json" \ | |
https://api.github.com/repos/scverse/scverse.github.io/actions/workflows/gh-pages.yml/dispatches \ | |
--data '{"ref": "main"}' |