diff --git a/.github/workflows/cleanup-cloudflare-previews.yml b/.github/workflows/cleanup-cloudflare-previews.yml index a18b2da9..742d3c98 100644 --- a/.github/workflows/cleanup-cloudflare-previews.yml +++ b/.github/workflows/cleanup-cloudflare-previews.yml @@ -1,7 +1,7 @@ name: Clean up Cloudflare Pages previews # When a branch is deleted, remove that branch's preview deployments from the -# Cloudflare Pages project (named after the repository), so old previews stop +# matgui-doc Cloudflare Pages project, so old previews stop # being reachable. Production deployments of main are never touched. on: delete: @@ -18,13 +18,12 @@ jobs: CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} BRANCH: ${{ github.event.ref }} - REPOSITORY: ${{ github.event.repository.name }} run: | if [ -z "$CLOUDFLARE_API_TOKEN" ] || [ -z "$CLOUDFLARE_ACCOUNT_ID" ]; then echo "::notice::Cloudflare secrets are not available; nothing to clean up." exit 0 fi - project=$(echo "$REPOSITORY" | tr '[:upper:]' '[:lower:]') + project=matgui-doc api="https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects/$project/deployments" auth="Authorization: Bearer $CLOUDFLARE_API_TOKEN" diff --git a/.github/workflows/deploy-cloudflare.yml b/.github/workflows/deploy-cloudflare.yml index fc6b64be..a38924fc 100644 --- a/.github/workflows/deploy-cloudflare.yml +++ b/.github/workflows/deploy-cloudflare.yml @@ -1,8 +1,8 @@ name: Deploy to Cloudflare Pages # Every branch gets its own preview at https://..pages.dev, -# main is the production deployment. The Cloudflare Pages project is named -# after the repository and is created on the first run. +# main is the production deployment. The Cloudflare Pages project is called +# matgui-doc (it serves matgui-doc.matdata.eu) and is created on the first run. on: push: branches: ["**"] @@ -75,7 +75,7 @@ jobs: - name: Project name id: project - run: echo "name=$(echo '${{ github.event.repository.name }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + run: echo "name=matgui-doc" >> "$GITHUB_OUTPUT" - name: Deploy to Cloudflare Pages id: deploy