Skip to content

Commit

Permalink
chore: Add GitHub pages deploy workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Jan 26, 2025
1 parent e65fb35 commit 2f748a8
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 14 deletions.
24 changes: 12 additions & 12 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
bazel-opt_task:
container:
image: toxchat/toktok-stack:latest-release
cpu: 2
memory: 2G
configure_script:
- /src/workspace/tools/inject-repo btox
test_all_script:
- cd /src/workspace && bazel test -k
--remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST
//btox/...
# ---
# bazel-opt_task:
# container:
# image: toxchat/toktok-stack:latest-release
# cpu: 2
# memory: 2G
# configure_script:
# - /src/workspace/tools/inject-repo btox
# test_all_script:
# - cd /src/workspace && bazel test -k
# --remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST
# //btox/...
48 changes: 48 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: pages

on:
push:
branches: ["master"]

workflow_dispatch:

env:
FLUTTER_VERSION: "3.27.1"

jobs:
deploy-pages:
runs-on: ubuntu-24.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

permissions:
contents: read
id-token: write
pages: write

steps:
- name: Checkout tree
uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true

- name: Build content
run: |
./tools/prepare-web
flutter build web --base-href "/btox/"
- name: Set-up Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/web

- name: Deploy GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 5 additions & 2 deletions .restyled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
exclude:
- "LICENSE"
# Generated files.
- "linux/flutter/generated_plugin_registrant.cc"
- "windows/flutter/generated_plugin_registrant.cc"
- "linux/**/*.cc"
- "linux/**/*.h"
- "web/flutter_bootstrap.js"
- "windows/**/*.cc"
- "windows/**/*.h"
12 changes: 12 additions & 0 deletions web/flutter_bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{flutter_js}}
{{flutter_build_config}}

_flutter.loader.load({
onEntrypointLoaded: async function (engineInitializer) {
const appRunner = await engineInitializer.initializeEngine({
useColorEmoji: true,
});

await appRunner.runApp();
},
});

0 comments on commit 2f748a8

Please sign in to comment.