Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/deploy-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Deploy Flutter Web to GitHub Pages

on:
push:
# FIXME: Change to [ main ] when merging to upstream - this is currently set for fork development
branches: [ feat/migrate-to-bdaya-oidc-security-fix ]
# FIXME: Add back pull_request trigger when merging to upstream:
# pull_request:
# branches: [ main ]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
cache: true

- name: Disable Flutter analytics
run: flutter config --no-analytics

- name: Cache pub dependencies
uses: actions/cache@v4
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: ${{ runner.os }}-pub-

- name: Install dependencies (root)
run: flutter pub get

- name: Install dependencies (example)
run: |
cd example
flutter pub get

- name: Build web app
run: |
cd example
flutter build web --release --base-href /solid_auth/example/

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Prepare deployment directory
run: |
# Create a deployment directory
mkdir -p deploy/example

# Copy Flutter web build (built in example directory)
cp -r example/build/web/* deploy/example/

# Copy client profile and redirect files
cp example/client-profile.jsonld deploy/example/
cp example/redirect.html deploy/example/


- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./deploy

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
# FIXME: Change to `if: github.ref == 'refs/heads/main'` when merging to upstream
if: github.ref == 'refs/heads/feat/migrate-to-bdaya-oidc-security-fix'
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
Loading