-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (71 loc) · 2.61 KB
/
Copy pathrelease-web.yml
File metadata and controls
85 lines (71 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release Web to Cloudflare Pages
on:
push:
tags:
- 'v*' # Matches any tag starting with 'v' (e.g., v2025.12.1, v2025.12.0)
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: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
VERSION="${{ inputs.version }}"
else
VERSION="${GITHUB_REF#refs/tags/}"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "version_number=${VERSION#v}" >> $GITHUB_OUTPUT
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.38.3'
channel: 'stable'
cache: true
- name: Create Firebase google-services.json
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > android/app/google-services.json
- name: Get dependencies
run: flutter pub get
- name: Generate mocks
run: dart run build_runner build --delete-conflicting-outputs
- name: Analyze code
run: flutter analyze --no-fatal-infos
- name: Run tests
run: flutter test
- name: Get git version info
id: git_version
run: |
chmod +x scripts/get_version_info.sh
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