From ad0833cd64559719cddbea9ea5208e80ae8b9cae Mon Sep 17 00:00:00 2001 From: chooyan-eng Date: Thu, 29 Feb 2024 18:57:30 +0900 Subject: [PATCH 1/3] add github action for publish --- .github/workflows/gh-pages.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/gh-pages.yaml diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml new file mode 100644 index 0000000..ebf0f6c --- /dev/null +++ b/.github/workflows/gh-pages.yaml @@ -0,0 +1,17 @@ +name: Gh-Pages + +on: + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + - uses: bluefireteam/flutter-gh-pages@v8 + with: + baseHref: /flutter_night_2/ + webRenderer: canvaskit \ No newline at end of file From cfb1f3ffeee101be62c5f345319dc9515d3e344a Mon Sep 17 00:00:00 2001 From: chooyan-eng Date: Thu, 29 Feb 2024 18:58:56 +0900 Subject: [PATCH 2/3] fix repo name --- .github/workflows/gh-pages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index ebf0f6c..79b1ff8 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -13,5 +13,5 @@ jobs: - uses: subosito/flutter-action@v2 - uses: bluefireteam/flutter-gh-pages@v8 with: - baseHref: /flutter_night_2/ + baseHref: /flutter_night_2_slide/ webRenderer: canvaskit \ No newline at end of file From 893bc5bab3c5a2816daf410f94d880b04e49ddcc Mon Sep 17 00:00:00 2001 From: chooyan-eng Date: Fri, 1 Mar 2024 10:15:39 +0900 Subject: [PATCH 3/3] change workflow steps --- .github/workflows/gh-pages.yaml | 37 +++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/gh-pages.yaml index 79b1ff8..78f797c 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/gh-pages.yaml @@ -1,17 +1,42 @@ -name: Gh-Pages +name: github pages on: push: branches: [ main ] + workflow_dispatch: + jobs: build: runs-on: ubuntu-latest - + timeout-minutes: 30 steps: - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2 - - uses: bluefireteam/flutter-gh-pages@v8 with: - baseHref: /flutter_night_2_slide/ - webRenderer: canvaskit \ No newline at end of file + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Repository + id: version + run: | + REPOSITORY=$(echo ${{ github.repository }} | sed -e "s#.*/##") + echo ::set-output name=repository::$REPOSITORY + + - name: Get Flutter version + uses: kuhnroyal/flutter-fvm-config-action@v1 + + - name: Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: ${{ env.FLUTTER_CHANNEL }} + cache: true + + - run: flutter --version + - run: flutter pub get + - run: flutter build web --web-renderer html --base-href /${{ steps.version.outputs.repository }}/ + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./build/web \ No newline at end of file