🐛 bug fix #24
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Web Release | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Create Web Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: "12.x" | |
cache: gradle | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
cache: true | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Start Web Release Build | |
run: flutter build web --release | |
- name: Upload Web Build Files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: web-release | |
path: ./build/web | |
# - name: Copy Build Files to Deployment Repository | |
# run: | | |
# mkdir deployment | |
# cp -r build/web/* deployment/ | |
# cd deployment | |
# git init | |
# # git remote add origin https://github.com/TESLA2402/Portfolio.git | |
# git remote add origin https://${{ secrets.GITHUB_PAT }}@github.com/TESLA2402/Portfolio.git | |
# git config --global user.email "lakshay6447@gmail.com" | |
# git config --global user.name "TESLA2402" | |
# git checkout -b main # Or the branch where you want to deploy | |
# git add . | |
# git commit -m "Deploy latest build" | |
# git config credential.helper store | |
# git push -f origin main # Force push to update the deployment repo | |
# - name: Clean up | |
# run: | | |
# cd .. | |
# rm -rf deployment # Clean up the temporary deployment directory | |
deploy: | |
name: Deploy Web Build | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Web Release | |
uses: actions/download-artifact@v3 | |
with: | |
name: web-release | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./ | |
commit_message: ":rocket: deploy:" |