mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-13 17:50:34 +08:00
CI: improve cloudflare wrangler cache
This commit is contained in:
parent
d82161cbd2
commit
a61248aeb0
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
@ -144,6 +144,10 @@ jobs:
|
|||||||
name: Deploy to Cloudflare Pages
|
name: Deploy to Cloudflare Pages
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
runs-on: ubuntu-24.04-arm
|
runs-on: ubuntu-24.04-arm
|
||||||
|
# matrix is a tricky way to define a variable directly in the jon yaml
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
wranglerVersion: ['3.114.6']
|
||||||
steps:
|
steps:
|
||||||
- name: Get NPM cache directory path
|
- name: Get NPM cache directory path
|
||||||
id: npm_cache_path
|
id: npm_cache_path
|
||||||
@ -154,7 +158,7 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
${{ steps.npm_cache_path.outputs.dir }}
|
${{ steps.npm_cache_path.outputs.dir }}
|
||||||
node_modules
|
node_modules
|
||||||
key: ${{ runner.os }}-${{ runner.arch }}-deploy-to-cloudflare-npm
|
key: deploy-to-cloudflare-npm-${{ runner.os }}-${{ runner.arch }}-wrangler-${{ matrix.wranglerVersion }}
|
||||||
- uses: actions/download-artifact@v4
|
- uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: build-artifact-${{ github.sha }}-${{ github.run_number }}
|
name: build-artifact-${{ github.sha }}-${{ github.run_number }}
|
||||||
@ -165,13 +169,13 @@ jobs:
|
|||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
command: pages deploy public --project-name=sukkaw-ruleset --commit-dirty=true --branch=main
|
command: pages deploy public --project-name=sukkaw-ruleset --commit-dirty=true --branch=main
|
||||||
wranglerVersion: '3.90.0'
|
wranglerVersion: ${{ matrix.wranglerVersion }}
|
||||||
- uses: actions/cache/save@v4
|
- uses: actions/cache/save@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ steps.npm_cache_path.outputs.dir }}
|
${{ steps.npm_cache_path.outputs.dir }}
|
||||||
node_modules
|
node_modules
|
||||||
key: ${{ runner.os }}-${{ runner.arch }}-deploy-to-cloudflare-npm
|
key: deploy-to-cloudflare-npm-${{ runner.os }}-${{ runner.arch }}-wrangler-${{ matrix.wranglerVersion }}
|
||||||
deploy_to_github_gitlab:
|
deploy_to_github_gitlab:
|
||||||
needs:
|
needs:
|
||||||
- build
|
- build
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user