Skip to content

Update static.yml

Update static.yml #6

Workflow file for this run

name: Build and Deploy Flutter Web App
on:
# Trigger on pushes to the master branch
push:
branches: [ master ]
# Allow manual triggering
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- name: Get dependencies
run: flutter pub get
- name: Enable web support
run: flutter config --enable-web
- name: Build web app
run: flutter build web -t web
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: web-build
path: ./web-demo/build/web
# Assuming you want to deploy to GitHub Pages (replace with your deployment step if needed)
deploy-to-github-pages (optional):

Check failure on line 38 in .github/workflows/static.yml

View workflow run for this annotation

GitHub Actions / Build and Deploy Flutter Web App

Invalid workflow file

The workflow is not valid. .github/workflows/static.yml (Line: 38, Col: 3): The identifier 'deploy-to-github-pages (optional)' is invalid. IDs may only contain alphanumeric characters, '_', and '-'. IDs must start with a letter or '_' and and must be less than 100 characters.
runs-on: ubuntu-latest
needs: build-and-deploy
if: github.event.type == 'push' && github.base_branch == 'master' # Deploy only on push to master branch
environment:
name: production
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: web-build
- name: Deploy to GitHub Pages (requires GH Pages token)
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.MY_TOKEN }}
source: ./web-demo/build/web # Path to your built web app
branch: gh-pages # Target branch for deployment (replace if needed)
fail_on_errors: true # Fail workflow on deployment errors