https://pvzm.net/ to play [Read-only GitHub mirror] pvzm.net
modded vs pvz plants-vs-zombies plantsvszombies javascript online zombie noads jspvz pvzm game plants plant
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add cf pages skip to workflow

authored by

Clay and committed by
GitHub
f3b8368f 2d412dbc

+64 -95
+64
.github/workflows/format-stamp.yml
··· 1 + name: Format & stamp 2 + 3 + on: 4 + push: 5 + branches: 6 + - main 7 + - staging 8 + workflow_dispatch: 9 + 10 + permissions: 11 + contents: write 12 + deployments: write 13 + 14 + jobs: 15 + build-and-deploy: 16 + runs-on: blacksmith-4vcpu-ubuntu-2404 17 + env: 18 + PNPM_HOME: /home/runner/.local/share/pnpm 19 + steps: 20 + - name: Checkout repository 21 + uses: actions/checkout@v4 22 + with: 23 + fetch-depth: 1 24 + 25 + - name: Setup Node.js & pnpm 26 + uses: actions/setup-node@v4 27 + with: 28 + node-version: "lts/*" 29 + 30 + - name: Install pnpm 31 + run: | 32 + corepack enable pnpm 33 + mkdir -p "$PNPM_HOME" 34 + echo "$PNPM_HOME" >> "$GITHUB_PATH" 35 + 36 + - name: Cache pnpm global packages 37 + uses: actions/cache@v4 38 + with: 39 + path: | 40 + ~/.local/share/pnpm/global 41 + key: pnpm-global-${{ hashFiles('pnpm-lock.yaml') }} 42 + restore-keys: pnpm-global- 43 + 44 + - name: Install dependencies 45 + run: pnpm add -g oxlint oxfmt esbuild html-minifier-terser 46 + 47 + - name: Lint, format & version stamp 48 + run: | 49 + pnpm run fix || true 50 + pnpm oxfmt --write . "**/*.{js,md,html,css,yml}" 51 + echo "${{ github.sha }}" > game/images/Zombies/CX/v.html 52 + 53 + - name: Commit changes 54 + run: | 55 + COMMIT_MSG=$(git log -1 --pretty=format:%s) 56 + AUTHOR_EMAIL=$(git log -1 --pretty=format:%ae) 57 + git config user.name github-actions 58 + git config user.email github-actions@github.com 59 + git add . 60 + git commit -m "Format \"$COMMIT_MSG\" [CF-Pages-Skip] 61 + Original commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} 62 + 63 + Co-authored-by: ${{ github.actor }} <$AUTHOR_EMAIL>" || exit 0 64 + git push
-95
.github/workflows/main.yml
··· 1 - name: Deploy 2 - 3 - on: 4 - push: 5 - branches: 6 - - main 7 - - staging 8 - workflow_dispatch: 9 - 10 - permissions: 11 - contents: write 12 - deployments: write 13 - 14 - concurrency: 15 - group: "cloudflare-pages" 16 - cancel-in-progress: false 17 - 18 - jobs: 19 - build-and-deploy: 20 - runs-on: blacksmith-4vcpu-ubuntu-2404 21 - env: 22 - PNPM_HOME: /home/runner/.local/share/pnpm 23 - steps: 24 - - name: Checkout repository 25 - uses: actions/checkout@v4 26 - with: 27 - fetch-depth: 1 28 - 29 - - name: Setup Node.js & pnpm 30 - uses: actions/setup-node@v4 31 - with: 32 - node-version: "lts/*" 33 - 34 - - name: Install pnpm 35 - run: | 36 - corepack enable pnpm 37 - mkdir -p "$PNPM_HOME" 38 - echo "$PNPM_HOME" >> "$GITHUB_PATH" 39 - 40 - - name: Cache pnpm global packages 41 - uses: actions/cache@v4 42 - with: 43 - path: | 44 - ~/.local/share/pnpm/global 45 - key: pnpm-global-${{ hashFiles('pnpm-lock.yaml') }} 46 - restore-keys: pnpm-global- 47 - 48 - - name: Install dependencies 49 - run: pnpm add -g oxlint oxfmt esbuild html-minifier-terser 50 - 51 - - name: Lint, format & version stamp 52 - run: | 53 - pnpm run fix # fix 5: removed `|| true`, lint failures now fail build 54 - pnpm oxfmt --write . "**/*.{js,md,html,css,yml}" 55 - echo "${{ github.sha }}" > game/images/Zombies/CX/v.html 56 - 57 - - name: Commit changes 58 - run: | 59 - COMMIT_MSG=$(git log -1 --pretty=format:%s) 60 - AUTHOR_EMAIL=$(git log -1 --pretty=format:%ae) 61 - git config user.name github-actions 62 - git config user.email github-actions@github.com 63 - git add . 64 - git commit -m "Format \"$COMMIT_MSG\" 65 - Original commit: https://github.com/${{ github.repository }}/commit/${{ github.sha }} 66 - 67 - Co-authored-by: ${{ github.actor }} <$AUTHOR_EMAIL>" || exit 0 68 - git push 69 - 70 - - name: Bundle & minify all assets 71 - run: | 72 - esbuild game/js/CPlants.js \ 73 - --bundle --minify --sourcemap \ # fix 7: removed --sources-content=true 74 - --outfile=game/js/CPlants.js --allow-overwrite 75 - 76 - find . -type f -name "*.js" -o -name "*.css" \ # fix 6: xargs to avoid ARG_MAX 77 - -not -path "./node_modules/*" -not -name "CPlants.js" | \ 78 - xargs -P4 -I{} esbuild {} \ 79 - --minify --sourcemap \ 80 - --outdir=. --allow-overwrite & 81 - 82 - find . -type f -name "*.html" -not -path "./node_modules/*" | \ 83 - xargs -P4 -I{} html-minifier-terser \ 84 - --collapse-whitespace --remove-comments --remove-tag-whitespace \ 85 - --minify-css true --minify-js true -o {} {} & 86 - 87 - wait 88 - 89 - - name: Deploy 90 - uses: cloudflare/wrangler-action@v3 91 - with: 92 - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} 93 - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} 94 - command: pages deploy . --project-name=pvz --branch=${{ github.ref_name }} 95 - gitHubToken: ${{ secrets.GITHUB_TOKEN }}