Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/cleanup-cloudflare-previews.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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"

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-cloudflare.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Deploy to Cloudflare Pages

# Every branch gets its own preview at https://<branch>.<project>.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: ["**"]
Expand Down Expand Up @@ -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
Expand Down
Loading