-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (121 loc) · 4.72 KB
/
Copy pathexplore.yml
File metadata and controls
140 lines (121 loc) · 4.72 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# explore.yml — Flutter web companion app pipeline
#
# Independent of the Rust ci.yml (which is paused during bootstrap;
# see CLAUDE.md principle 2). Scoped via `paths:` so changes outside
# apps/escurel-explore/ and the example tenant do not trigger
# Flutter setup.
#
# Triggers:
# - workflow_dispatch (manual)
# - push to main touching the relevant paths → build + push image
#
# Image: ghcr.io/<owner>/escurel-explore:sha-<short>
# + ghcr.io/<owner>/escurel-explore:latest
# + ghcr.io/<owner>/escurel-explore:main (substrate deploy default)
#
# Operator promotes via the substrate repo's /deploy-green flow.
# Auto-promotion to Nomad is intentionally deferred until the
# substrate's API token + workflow are wired up.
name: explore
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'apps/escurel-explore/**'
- 'packages/escurel_explorer_kit/**'
- 'examples/crm-demo/**'
- '.github/workflows/explore.yml'
concurrency:
group: explore-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 25
defaults:
run:
working-directory: apps/escurel-explore
steps:
- uses: actions/checkout@v4
# ghcr.io rejects uppercase repository paths. github.repository_owner
# is "DataZooDE" here; emit a lowercased alias for image tags.
- name: derive lowercase owner + short sha
id: meta
run: |
{
echo "owner_lc=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
echo "sha_short=${GITHUB_SHA::7}"
} >> "$GITHUB_OUTPUT"
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.44.0'
channel: stable
cache: true
# The shared kit is analyzed + tested in its own package first;
# the app depends on it by path.
- name: kit — flutter pub get
working-directory: packages/escurel_explorer_kit
run: flutter pub get
- name: kit — flutter analyze
working-directory: packages/escurel_explorer_kit
run: flutter analyze
- name: kit — flutter test
working-directory: packages/escurel_explorer_kit
run: flutter test --reporter expanded
- name: flutter pub get
run: flutter pub get
- name: flutter analyze
run: flutter analyze
- name: flutter test
run: flutter test --reporter expanded
# The shipped bundle is built inside the Dockerfile (http mode). Keep
# a CI smoke build so a broken web build fails fast before docker.
- name: flutter build web (smoke)
run: |
flutter build web --release \
--dart-define=ESCUREL_EXPLORE_MODE=http \
--dart-define=ESCUREL_EXPLORE_VERSION=${GITHUB_SHA::7}
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Context is the REPO ROOT so the Rust workspace sources are available
# to the Dockerfile's BFF build stage; the Flutter bundle is built in
# the Dockerfile's first stage (http mode, same-origin).
- name: docker build + push
uses: docker/build-push-action@v6
with:
context: .
file: apps/escurel-explore/Dockerfile
push: true
build-args: |
BUILD_VERSION=${{ steps.meta.outputs.sha_short }}
tags: |
ghcr.io/${{ steps.meta.outputs.owner_lc }}/escurel-explore:sha-${{ steps.meta.outputs.sha_short }}
ghcr.io/${{ steps.meta.outputs.owner_lc }}/escurel-explore:latest
ghcr.io/${{ steps.meta.outputs.owner_lc }}/escurel-explore:main
# Scoped. Both this workflow and the other image build in this repo
# used a bare `type=gha`, which is ONE shared scope — the Flutter SPA image
# and the other were overwriting each other's layer cache, so
# whichever ran last left the other cold. Distinct scopes give each
# image its own.
cache-from: type=gha,scope=escurel-explore
cache-to: type=gha,mode=max,scope=escurel-explore
- name: Summary
run: |
{
echo "## escurel-explore deploy candidate"
echo ""
echo "Image: \`ghcr.io/${{ steps.meta.outputs.owner_lc }}/escurel-explore:sha-${{ steps.meta.outputs.sha_short }}\`"
echo ""
echo "Operator next step:"
echo "\`\`\`"
echo "/deploy-green dz-escurel-explore ${{ steps.meta.outputs.sha_short }}"
echo "\`\`\`"
} >> "$GITHUB_STEP_SUMMARY"