Skip to content

Commit

Permalink
ci: create github pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
harlanx committed Aug 11, 2024
1 parent 53f579b commit c5d2195
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: GH-Pages
on:
workflow_dispatch:
permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: Install Dependencies
run: flutter pub get
- name: Build Web
run: flutter build web --release --base-href /${{github.event.repository.name}}/
- name: Deploy
run: |
cd build/web
git init
git config user.name "harlanx"
git config user.email "silan.harry@gmail.com"
git remote add secure-origin https://username:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git
git checkout -b gh-pages
git add .
git commit -m "Deployed Github Pages"
git push --force secure-origin gh-pages

0 comments on commit c5d2195

Please sign in to comment.