-
Notifications
You must be signed in to change notification settings - Fork 6
ci: publish PR web previews #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
2398803
refactor(frontend): add tested shared overlays
1f5f1cf
feat(frontend): add session transport and contracts
e725131
feat(frontend): add schedule workflows
05d2316
feat(frontend): add voice assistant flows
e31e7b4
feat(frontend): add native alarms and voice recording
5e3bcab
feat(frontend): integrate connected app flows
8c47926
ci: publish PR web previews
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: PR Preview | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize, closed] | ||
|
|
||
| permissions: | ||
| contents: write | ||
| deployments: read | ||
| pull-requests: write | ||
|
|
||
| concurrency: | ||
| group: pr-preview-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| deploy-preview: | ||
| name: Deploy web preview | ||
| if: github.event.pull_request.head.repo.full_name == github.repository | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.action == 'closed' && github.event.pull_request.base.sha || github.event.pull_request.head.sha }} | ||
|
|
||
| - name: Set up Node.js | ||
| if: github.event.action != 'closed' | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20.20.2 | ||
| cache: npm | ||
| cache-dependency-path: frontend/package-lock.json | ||
|
|
||
| - name: Install frontend dependencies | ||
| if: github.event.action != 'closed' | ||
| working-directory: frontend | ||
| run: npm ci | ||
|
|
||
| - name: Export interactive web preview | ||
| if: github.event.action != 'closed' | ||
| working-directory: frontend | ||
| env: | ||
| EXPO_PUBLIC_USE_FAKE_WS: 'true' | ||
| EXPO_PUBLIC_WS_URL: '' | ||
| TIMEFLOW_PREVIEW_BASE_URL: /${{ github.event.repository.name }}/pr-preview/pr-${{ github.event.number }} | ||
| run: npx expo export --platform web --dev --output-dir dist | ||
|
|
||
| - name: Deploy preview and comment on PR | ||
| uses: rossjrw/pr-preview-action@ffa7509e91a3ec8dfc2e5536c4d5c1acdf7a6de9 # v1.8.1 | ||
| with: | ||
| source-dir: frontend/dist | ||
| preview-branch: gh-pages | ||
| umbrella-dir: pr-preview | ||
| action: auto | ||
| wait-for-pages-deployment: true | ||
| comment: true | ||
| qr-code: true | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,14 @@ | ||
| # Android emulator: 10.0.2.2 reaches the host machine. | ||
| EXPO_PUBLIC_API_URL=http://10.0.2.2:8000/api/v1 | ||
| # Baidu Maps browser-side AK with JavaScript API enabled. | ||
| # Allow localhost for web development and https://timeflow.local/* for the native WebView. | ||
| EXPO_PUBLIC_BAIDU_MAP_AK=replace-with-your-baidu-map-ak | ||
|
|
||
| # Real backend WebSocket URL (required for release / production builds). | ||
| # The client appends its persisted device_id query parameter automatically. | ||
| # Local device example: ws://192.168.1.10:8000/ws | ||
| # Production example: wss://api.example.com/ws | ||
| EXPO_PUBLIC_WS_URL= | ||
|
|
||
| # Use in-process FakeWsServer when EXPO_PUBLIC_WS_URL is empty. | ||
| # In __DEV__, Fake is allowed by default if this is unset. | ||
| # Release builds always ignore this flag and fail fast without a URL. | ||
| # EXPO_PUBLIC_USE_FAKE_WS=true |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,16 @@ | ||
| import { HomeScreen } from './src/screens/HomeScreen'; | ||
| import { AppRoot } from '@/app/AppRoot'; | ||
| import { AppProviders } from '@/app/providers'; | ||
| import { useAlarmPermissionsOnLaunch } from '@/features/reminder'; | ||
|
|
||
| function Root() { | ||
| useAlarmPermissionsOnLaunch(); | ||
| return <AppRoot />; | ||
| } | ||
|
|
||
| export default function App() { | ||
| return <HomeScreen />; | ||
| return ( | ||
| <AppProviders> | ||
| <Root /> | ||
| </AppProviders> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P1] Do not unconditionally skip fork PRs if previews are meant for contributor PRs. This condition evaluates false for this PR (
gac0812/Tfgxs), so the preview job is skipped entirely and no URL/QR comment is published. A fork-safe design needs to build without write credentials and perform the Pages update in a trusted follow-up job, or the preview contract should explicitly document that fork PRs are unsupported.