Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
workflow_dispatch:

permissions:
actions: read
contents: read
pages: write
id-token: write
Expand Down Expand Up @@ -44,5 +45,21 @@ jobs:
- uses: actions/upload-pages-artifact@v3
with:
path: dist
# GitHub lists a new artifact a few seconds after it is uploaded, and deploy-pages looks for it at once: when the list is
# late it stops with "Found 0 artifact(s)" although the artifact exists. This waits until the list returns it (2 minutes at most).
- name: Wait until GitHub lists the artifact
env:
GH_TOKEN: ${{ github.token }}
run: |
for attempt in $(seq 1 24); do
found=$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/artifacts" --jq '[.artifacts[] | select(.name == "github-pages")] | length')
if [ "${found}" -gt 0 ]; then
echo "The artifact is listed (attempt ${attempt})."
exit 0
fi
echo "The artifact is not listed yet (attempt ${attempt}); waiting 5 seconds."
sleep 5
done
echo "The artifact was not listed after 2 minutes; deploy-pages will try anyway."
- id: deployment
uses: actions/deploy-pages@v4
Loading