shitman/.forgejo/workflows/main-build.yaml
zeyus a931a6aa4c
All checks were successful
/ build-web (push) Successful in 5m57s
web pub
2025-07-23 00:03:19 +02:00

58 lines
1.6 KiB
YAML

on:
push:
branches:
- main
jobs:
build-web:
# custom runner image -> includes node and latest flutter stable
runs-on: flutter-web-builder
steps:
- name: Checkout code
uses: actions/checkout@v4
# Cache pub dependencies (this should work now)
- name: Cache pub dependencies
uses: actions/cache@v4
id: cache-pub
with:
path: /opt/pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
# Cache build outputs and tool cache
- name: Cache Flutter build
uses: actions/cache@v4
with:
path: |
.dart_tool
build
key: ${{ runner.os }}-flutter-build-${{ hashFiles('**/pubspec.lock') }}-${{ hashFiles('lib/**/*.dart') }}
restore-keys: |
${{ runner.os }}-flutter-build-${{ hashFiles('**/pubspec.lock') }}-
${{ runner.os }}-flutter-build-
- name: Get dependencies
run: flutter pub get
- name: Build web
run: flutter build web --wasm --release --base-href /shitman/
# if the /webpub mount exists, copy the build output there
- name: Copy build output to /webpub
run: |
if [ -d /webpub ]; then
cp -r build/web/* /webpub/
else
echo "No /webpub mount found, skipping copy."
fi
- name: List build output
run: ls -la build/web/
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: web-build
path: build/web/