mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-14 02:00:37 +08:00
CI: deploy to Cloudflare Pages
This commit is contained in:
parent
ce32b2177a
commit
ad22a0f225
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -64,6 +64,12 @@ jobs:
|
|||||||
echo "public directory is empty"
|
echo "public directory is empty"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
- name: Deploy to Cloudflare Pages
|
||||||
|
uses: cloudflare/wrangler-action@v3
|
||||||
|
with:
|
||||||
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
command: pages deploy public --project-name=sukkaw-ruleset --commit-dirty=true --branch=main
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: peaceiris/actions-gh-pages@v4
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@ -52,7 +52,19 @@ export const downloadPreviousBuild = task(require.main === module, __filename)(a
|
|||||||
return span
|
return span
|
||||||
.traceChild('download & extract previoud build')
|
.traceChild('download & extract previoud build')
|
||||||
.traceAsyncFn(async () => {
|
.traceAsyncFn(async () => {
|
||||||
const resp = await fetchWithRetry('https://codeload.github.com/sukkalab/ruleset.skk.moe/tar.gz/master', defaultRequestInit);
|
const resp = await fetchWithRetry('https://codeload.github.com/sukkalab/ruleset.skk.moe/tar.gz/master', {
|
||||||
|
...defaultRequestInit,
|
||||||
|
retry: {
|
||||||
|
retryOnNon2xx: false
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (resp.status !== 200) {
|
||||||
|
console.warn('Download previous build failed! Status:', resp.status);
|
||||||
|
if (resp.status === 404) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!resp.body) {
|
if (!resp.body) {
|
||||||
throw new Error('Download previous build failed! No body found');
|
throw new Error('Download previous build failed! No body found');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user