Handle missing contact form item tag labels (#1478) #3254
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 to Neocities and Bunny CDN | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| name: Build and Deploy | |
| # runs-on: ubuntu-latest # YOU PROBABLY WANT THIS! | |
| runs-on: ubicloud-standard-16 | |
| env: | |
| NEOCITIES_API_KEY: ${{ secrets.NEOCITIES_API_KEY }} | |
| BUNNY_ACCESS_KEY: ${{ secrets.BUNNY_ACCESS_KEY }} | |
| INDEXNOW_KEY: ${{ secrets.INDEXNOW_KEY }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Restore image cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .image-cache | |
| key: images-${{ hashFiles('src/images/**/*') }} | |
| restore-keys: | | |
| images- | |
| - name: Update config.json with secrets | |
| run: | | |
| sed -i 's|"formspark_id": null|"formspark_id": "${{ secrets.FORMSPARK_ID }}"|g' src/_data/config.json | |
| sed -i 's|"botpoison_public_key": null|"botpoison_public_key": "${{ secrets.BOTPOISON_PUBLIC_KEY }}"|g' src/_data/config.json | |
| sed -i 's|"ecommerce_api_host": null|"ecommerce_api_host": "${{ secrets.ECOMMERCE_API_HOST }}"|g' src/_data/config.json | |
| sed -i 's|"stripe_publishable_key": null|"stripe_publishable_key": "${{ secrets.STRIPE_PUBLISHABLE_KEY }}"|g' src/_data/config.json | |
| sed -i 's|"cart_mode": null|"cart_mode": "${{ secrets.CART_MODE }}"|g' src/_data/config.json | |
| sed -i 's|"ntfy_channel": null|"ntfy_channel": "${{ secrets.NTFY_FRONTEND_TOPIC }}"|g' src/_data/config.json | |
| - name: Build Site | |
| run: | | |
| bun install --frozen-lockfile | |
| bun run build | |
| - name: Write IndexNow key file | |
| if: github.ref == 'refs/heads/main' && env.INDEXNOW_KEY != '' | |
| run: echo "${{ secrets.INDEXNOW_KEY }}" > "_site/${{ secrets.INDEXNOW_KEY }}.txt" | |
| - name: Deploy to Neocities | |
| if: github.ref == 'refs/heads/main' && env.NEOCITIES_API_KEY != '' | |
| uses: bcomnes/deploy-to-neocities@v3 | |
| with: | |
| api_key: ${{ secrets.NEOCITIES_API_KEY }} | |
| cleanup: true | |
| neocities_supporter: true | |
| preview_before_deploy: false | |
| dist_dir: _site | |
| - name: Deploy to Bunny CDN | |
| if: github.ref == 'refs/heads/main' && env.BUNNY_ACCESS_KEY != '' | |
| uses: R-J-dev/bunny-deploy@v2.0.6 | |
| with: | |
| access-key: ${{ secrets.BUNNY_ACCESS_KEY }} | |
| directory-to-upload: _site | |
| storage-endpoint: "https://storage.bunnycdn.com" | |
| storage-zone-name: "chobble-example" | |
| storage-zone-password: ${{ secrets.BUNNY_STORAGE_ZONE_PASSWORD }} | |
| concurrency: "5" | |
| enable-delete-action: true | |
| enable-purge-pull-zone: true | |
| pull-zone-id: 4582983 | |
| replication-timeout: "15000" | |
| - name: Get site URL | |
| id: site-url | |
| run: echo "url=$(jq -r '.url' src/_data/site.json)" >> $GITHUB_OUTPUT | |
| - name: Submit to IndexNow | |
| if: github.ref == 'refs/heads/main' && env.INDEXNOW_KEY != '' | |
| uses: bojieyang/indexnow-action@v3 | |
| with: | |
| sitemap-location: "${{ steps.site-url.outputs.url }}/sitemap.xml" | |
| key: ${{ secrets.INDEXNOW_KEY }} | |
| notify-failure: | |
| name: Notify on Failure | |
| runs-on: ubuntu-latest | |
| needs: [build-and-deploy] | |
| if: failure() && github.ref_name == 'main' | |
| steps: | |
| - name: Send failure notification | |
| uses: NiNiyas/ntfy-action@master | |
| with: | |
| url: 'https://ntfy.sh' | |
| topic: ${{ secrets.NTFY_TOPIC }} |