Initial commit #8
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: Update index | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
# mutex | |
concurrency: | |
group: update-index | |
cancel-in-progress: false | |
jobs: | |
create-index: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create index | |
run: | | |
set -euxo pipefail | |
curl -H "Authorization: ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/leanprover/lean4/releases?per-page=100 > releases | |
curl -H "Authorization: ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/leanprover/lean4-nightly/releases?per-page=100 > releases-nightly | |
mkdir output | |
jq -s '{version: "1", stable: .[0] | map(select(.prerelease | not)), beta: .[0] | map(select(.prerelease)), nightly: .[1]}' releases releases-nightly > output/index.json | |
- name: Create artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: output | |
deploy: | |
needs: create-index | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |