Update README.md #3
This file contains 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
# Note: | |
# Make sure that the github pages is already set to Github Actions, otherwise the workflow will fail. | |
# | |
# Author: Shubham Gupta | |
# github: https://github.com/shubham-gupta-16/ | |
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
flutter_web_deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
# flutter-version: '3.0.5' // uncomment this line if you want to use a specific version of Flutter | |
- run: flutter pub get | |
- run: flutter build web --base-href /${{ github.event.repository.name }}/ | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: build/web | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@main |