From 6c7cf778ab212c0f9503455c882a6ca66ca67c0d Mon Sep 17 00:00:00 2001 From: Abdelaziz Mahdy Date: Wed, 14 Feb 2024 18:09:37 +0200 Subject: [PATCH 1/2] adding scripts to deployment --- .github/workflows/deploy.yml | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..3d836a1 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,49 @@ +name: Flutter Build and Deploy to GitHub Pages + +on: + push: + branches: + - master + + +# Explanation of the concurrency group: +# The 'group' value is dynamically determined based on the context of the workflow trigger. +# - If the workflow is triggered by a push to the 'main' branch (github.ref == 'refs/heads/main'), +# it uses the group name 'auto-deploy'. This groups all main branch workflows together, allowing +# newer runs to cancel in-progress runs, ensuring only the latest push to main is deployed. +# - For pull requests, the group name is set to a unique value for each run using the format +# 'pr-{run_id}'. This ensures that workflows triggered by pull requests each have their own +# concurrency group, so they don't cancel each other and are not affected by main branch workflows. + + + +jobs: + build_web: + name: Build Flutter Web, Deploy + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + channel: "stable" + # channel: "master" + cache: true + - name: cd example + run: cd example + + - name: Install Flutter Dependencies + run: flutter pub get + + - name: Build Flutter Web + run: flutter build web --profile --base-href "/mdcharts/" --web-renderer canvaskit + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/web + # publish_dir: ./build/web_wasm From a670e3dbc838190ba29858ee4adea3f2f0cffba8 Mon Sep 17 00:00:00 2001 From: Abdelaziz Mahdy Date: Wed, 14 Feb 2024 18:10:48 +0200 Subject: [PATCH 2/2] removing renderer --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3d836a1..c66b84b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,8 +39,8 @@ jobs: run: flutter pub get - name: Build Flutter Web - run: flutter build web --profile --base-href "/mdcharts/" --web-renderer canvaskit - + run: flutter build web --profile --base-href "/mdcharts/" + - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: