Rename workflows/jobs #9
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: Publish to GitHub Pages | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment, skip runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
lint: | |
name: Lint | |
uses: ./.github/workflows/lint.yaml | |
build: | |
name: Build JSON files | |
runs-on: ubuntu-latest | |
needs: lint | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Create dist dir | |
run: mkdir -p ./dist/tools | |
- name: Build index | |
run: yq -o=json -I=0 '.' tools/index.yaml > dist/index.json | |
- name: Build tools | |
run: | | |
for tool in $(yq '.[].name' tools/index.yaml); do | |
yq -o=json -I=0 '.' "tools/${tool}/data.yaml" > "dist/tools/${tool}.json" | |
done | |
- name: Build available Kube versions | |
run: | | |
for tool in $(yq '.[].name' "tools/index.yaml"); do | |
yq -o=props -I=0 '.compat_matrix[].kube_vers' "tools/${tool}/data.yaml" | |
done | jq -c -R -s 'split("\n")[:-1] | unique' > "dist/kube-vers.json" | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
deploy: | |
name: Deploy | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |