Remove ++ symbols from exhibition stand games blog post (#232) #1933
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| setup: | |
| name: Build & Deploy to Bunny | |
| runs-on: self-hosted | |
| steps: | |
| - name: Checkout this repo | |
| uses: actions/checkout@v4 | |
| with: | |
| path: source | |
| fetch-depth: 1 | |
| sparse-checkout-cone-mode: false | |
| sparse-checkout: | | |
| /* | |
| !old_site/ | |
| - name: Checkout Chobble Template | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: chobble-mirror/chobble-template | |
| path: template | |
| fetch-depth: 1 | |
| sparse-checkout-cone-mode: false | |
| sparse-checkout: | | |
| .eleventy.js | |
| package.json | |
| bun.lockb | |
| flake.nix | |
| flake.lock | |
| bin | |
| scripts | |
| src | |
| packages | |
| - name: Copy template files to combined dir | |
| run: | | |
| mkdir -p combined | |
| rsync \ | |
| --recursive \ | |
| --verbose \ | |
| --delete \ | |
| --exclude=".git" \ | |
| --exclude="*.md" \ | |
| --exclude="landing-pages" \ | |
| template/ \ | |
| combined/ | |
| - name: Overlay our repo files into combined src | |
| run: | | |
| rsync \ | |
| --recursive \ | |
| --verbose \ | |
| --exclude=".*" \ | |
| --exclude="README.md" \ | |
| --exclude="old_site" \ | |
| --exclude="package.json" \ | |
| --exclude="package-lock.json" \ | |
| --exclude="bun.lockb" \ | |
| source/ \ | |
| combined/src/ | |
| - name: Update site.json with secrets | |
| run: | | |
| sed -i \ | |
| 's/"formspark_id": null/"formspark_id": "${{ secrets.FORMSPARK_ID }}"/g' \ | |
| "combined/src/_data/config.json" | |
| sed -i \ | |
| 's/"botpoison_public_key": null/"botpoison_public_key": "${{ secrets.BOTPOISON_PUBLIC_KEY }}"/g' \ | |
| "combined/src/_data/config.json" | |
| - name: Check for existing Bun | |
| id: bun-check | |
| run: | | |
| if command -v bun &> /dev/null; then | |
| echo "found=true" >> $GITHUB_OUTPUT | |
| echo "Bun already installed: $(bun --version)" | |
| else | |
| echo "found=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Setup Bun | |
| if: steps.bun-check.outputs.found != 'true' | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Restore image cache | |
| uses: maxnowack/local-cache@v2 | |
| with: | |
| path: combined/.image-cache | |
| key: images-${{ hashFiles('source/images/**/*', 'source/_data/config.json') }} | |
| restore-keys: | | |
| images- | |
| - name: Build with Bun | |
| run: | | |
| cd combined | |
| bun install --frozen-lockfile | |
| bun scripts/eleventy-build.js | |
| mkdir -p ../_site | |
| mv _site/* ../_site/ | |
| - name: Set deployment environment | |
| id: deployment_env | |
| run: | | |
| if [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| echo "storage_zone_name=${{ secrets.BUNNY_PRODUCTION_STORAGE_ZONE_NAME }}" >> $GITHUB_OUTPUT | |
| echo "storage_zone_password=${{ secrets.BUNNY_PRODUCTION_STORAGE_ZONE_PASSWORD }}" >> $GITHUB_OUTPUT | |
| echo "pull_zone_id_deploy=${{ secrets.BUNNY_PRODUCTION_PULL_ZONE_ID }}" >> $GITHUB_OUTPUT | |
| echo "storage_endpoint=https://storage.bunnycdn.com" >> $GITHUB_OUTPUT | |
| else | |
| echo "storage_zone_name=${{ secrets.BUNNY_STAGING_STORAGE_ZONE_NAME }}" >> $GITHUB_OUTPUT | |
| echo "storage_zone_password=${{ secrets.BUNNY_STAGING_STORAGE_ZONE_PASSWORD }}" >> $GITHUB_OUTPUT | |
| echo "pull_zone_id_deploy=${{ secrets.BUNNY_STAGING_PULL_ZONE_ID }}" >> $GITHUB_OUTPUT | |
| echo "storage_endpoint=https://uk.storage.bunnycdn.com" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Deploy to Bunny | |
| uses: R-J-dev/bunny-deploy@v2.1.1 | |
| with: | |
| access-key: ${{ secrets.BUNNY_ACCESS_KEY }} | |
| directory-to-upload: _site | |
| storage-endpoint: ${{ steps.deployment_env.outputs.storage_endpoint }} | |
| storage-zone-name: ${{ steps.deployment_env.outputs.storage_zone_name }} | |
| storage-zone-password: ${{ steps.deployment_env.outputs.storage_zone_password }} | |
| concurrency: "50" | |
| enable-delete-action: true | |
| enable-purge-pull-zone: true | |
| pull-zone-id: ${{ steps.deployment_env.outputs.pull_zone_id_deploy }} | |
| replication-timeout: "15000" | |
| notify-failure: | |
| name: Notify on Failure | |
| runs-on: self-hosted | |
| needs: [setup] | |
| if: failure() | |
| steps: | |
| - name: Send failure notification | |
| uses: NiNiyas/ntfy-action@master | |
| with: | |
| url: "https://ntfy.sh" | |
| topic: ${{ secrets.NTFY_TOPIC }} |