Release Web to Cloudflare Pages #13
Workflow file for this run
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: Release Web to Cloudflare Pages | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version tag using CalVer (e.g., v2025.12.1 for Dec 2025, patch 1)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| deployments: write | |
| concurrency: | |
| group: cloudflare-pages-release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: production | |
| url: https://cambeerfestival.app | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Get version from tag | |
| id: version | |
| run: | | |
| VERSION="${{ inputs.version }}" | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "version_number=${VERSION#v}" >> $GITHUB_OUTPUT | |
| - name: Setup Flutter App | |
| uses: ./.github/actions/setup-flutter-app | |
| with: | |
| google-services-json: ${{ secrets.GOOGLE_SERVICES_JSON }} | |
| generate-mocks: 'true' | |
| - name: Analyze code | |
| run: flutter analyze --no-fatal-infos | |
| - name: Run tests | |
| run: flutter test | |
| - name: Get git version info | |
| id: git_version | |
| run: scripts/get_version_info.sh github >> $GITHUB_OUTPUT | |
| - name: Build web for Cloudflare Pages | |
| run: | | |
| flutter build web --release --base-href "/" \ | |
| --dart-define=GIT_TAG=${{ steps.git_version.outputs.git_tag }} \ | |
| --dart-define=GIT_COMMIT=${{ steps.git_version.outputs.git_commit }} \ | |
| --dart-define=GIT_BRANCH=${{ steps.git_version.outputs.git_branch }} \ | |
| --dart-define=BUILD_VERSION=${{ steps.git_version.outputs.version }} \ | |
| --dart-define=BUILD_TIME=${{ steps.git_version.outputs.build_time }} | |
| - name: Deploy to Cloudflare Pages (Production) | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy build/web --project-name=cambeerfestival --branch=release |