From 317e155070a73188dd95c249ae65702597d5917b Mon Sep 17 00:00:00 2001 From: WaoziXyz Date: Mon, 23 Sep 2024 13:15:37 +0700 Subject: [PATCH] attepmt fix --- .github/workflows/netlify_web_deploy.yml | 69 +++++++++++------------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/.github/workflows/netlify_web_deploy.yml b/.github/workflows/netlify_web_deploy.yml index 7404e8e..1bf86e3 100644 --- a/.github/workflows/netlify_web_deploy.yml +++ b/.github/workflows/netlify_web_deploy.yml @@ -1,53 +1,44 @@ name: Flutter Web Build and Deploy to Netlify - on: push: branches: - main - env: FLUTTER_VERSION: '3.24.3' NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - +permissions: + contents: write jobs: build-and-deploy: name: Build and Deploy to Netlify runs-on: ubuntu-latest steps: - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Cache Flutter SDK and dependencies - uses: actions/cache@v2 - with: - path: | - ~/.pub-cache - ~/.flutter - key: ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}-${{ hashFiles('**/pubspec.yaml') }} - restore-keys: | - ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}- - - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - - - name: Install Dependencies - run: flutter pub get - - - name: Build Web - run: flutter build web --release - - - name: Deploy to Netlify - uses: nwtgck/actions-netlify@v2.0 - with: - publish-dir: './build/web' - production-branch: main - github-token: ${{ secrets.GITHUB_TOKEN }} - deploy-message: "Deploy from GitHub Actions" - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} \ No newline at end of file + - name: Checkout Repository + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Cache Flutter SDK and dependencies + uses: actions/cache@v3 + with: + path: | + ~/.pub-cache + ~/.flutter + key: ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}-${{ hashFiles('**/pubspec.yaml') }} + restore-keys: | + ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}- + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + - name: Install Dependencies + run: flutter pub get + - name: Build Web + run: flutter build web --release + - name: Install Netlify CLI + run: npm install -g netlify-cli + - name: Deploy to Netlify + run: netlify deploy --prod --dir=build/web --site=$NETLIFY_SITE_ID + env: + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} \ No newline at end of file