feat: add downsized cover image #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Native Experimental to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main # Triggers on push to main branch | |
| workflow_dispatch: # Allows manual trigger from Actions tab | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: write # Need write to commit to gh-pages branch | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment for this workflow | |
| concurrency: | |
| group: "pages-native-experimental" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'master' # Use master channel for latest Flutter version | |
| cache: true | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build web with HTML renderer (native web elements) | |
| run: flutter build web --release --web-renderer html --base-href /${{ github.event.repository.name }}/native-experimental/ | |
| - name: Checkout gh-pages branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages | |
| path: gh-pages | |
| - name: Create native-experimental directory and copy build | |
| run: | | |
| mkdir -p gh-pages/native-experimental | |
| rm -rf gh-pages/native-experimental/* | |
| cp -r build/web/* gh-pages/native-experimental/ | |
| - name: Commit and push to gh-pages | |
| run: | | |
| cd gh-pages | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| git add native-experimental/ | |
| git diff --staged --quiet || git commit -m "Deploy native-experimental build from ${{ github.sha }}" | |
| git push origin gh-pages |