deploy to cloudflare pages (#477) #36
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: deploy | |
| on: [push] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Serve Website | |
| run: | | |
| deno task start & | |
| until curl --output /dev/null --silent --head --fail http://127.0.0.1:8005; do | |
| printf '.' | |
| sleep 1 | |
| done | |
| env: | |
| SIMPLECAST_API: ${{ secrets.SIMPLECAST_API }} | |
| UMAMI_WEBSITE_ID: ${{ secrets.UMAMI_WEBSITE_ID }} | |
| PAGE_SENSE_SCRIPT_SRC: ${{ secrets.PAGE_SENSE_SCRIPT_SRC }} | |
| timeout-minutes: 5 | |
| - name: Download Staticalize | |
| run: | | |
| wget https://github.com/thefrontside/staticalize/releases/download/v0.2.2/staticalize-linux.tar.gz \ | |
| -O /tmp/staticalize-linux.tar.gz | |
| tar -xzf /tmp/staticalize-linux.tar.gz -C /usr/local/bin | |
| chmod +x /usr/local/bin/staticalize-linux | |
| - name: Staticalize | |
| run: | | |
| staticalize-linux \ | |
| --site=http://127.0.0.1:8005 \ | |
| --output=built \ | |
| --base=https://frontside.com | |
| - name: Upload To Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy built --project-name=frontside | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} |