config #1893
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: config | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */6 * * *' # run every 6 hours | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
fetch_config: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4 | |
- name: fetch and display config | |
shell: bash # set -eo pipefail: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference | |
run: >- | |
ZONE_STATUS=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${{ secrets.ZONE_ID }}" | |
-H "Authorization: Bearer ${{ secrets.CF_TOKEN }}" | |
-H "Content-Type: application/json" | |
| jq -r .result.status) | |
curl -s -X GET "https://api.cloudflare.com/client/v4/zones/${{ secrets.ZONE_ID }}/spectrum/apps" | |
-H "Authorization: Bearer ${{ secrets.CF_TOKEN }}" | |
-H "Content-Type: application/json" | |
| jq --sort-keys --arg GITHUB_REPOSITORY $GITHUB_REPOSITORY --arg GITHUB_RUN_ID $GITHUB_RUN_ID --arg ZONE_STATUS $ZONE_STATUS -f filter.jq | |
| tee site/result.json | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 | |
with: | |
path: "site/" | |
deploy_page: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: fetch_config | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 |