CI: Add env variables and github pages
This commit is contained in:
parent
1529b19b58
commit
2496db5028
2 changed files with 16 additions and 4 deletions
16
.github/workflows/main_deploy.yaml
vendored
16
.github/workflows/main_deploy.yaml
vendored
|
|
@ -5,8 +5,12 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
env:
|
||||||
|
FLUTTER_VERSION: ${{ secrets.FLUTTER_VERSION }}
|
||||||
|
JAVA_VERSION: ${{ secrets.JAVA_VERSION }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_web:
|
deploy_web:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -16,14 +20,22 @@ jobs:
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: ${{ env.FLUTTER_VERSION }}
|
flutter-version: ${{ env.FLUTTER_VERSION }}
|
||||||
|
- name: Install dependencies
|
||||||
|
run: sudo apt-get update && sudo apt-get install node -y
|
||||||
- run: flutter pub get
|
- run: flutter pub get
|
||||||
- name: Prepare web
|
- name: Prepare web
|
||||||
run: ./scripts/prepare-web.sh
|
run: ./scripts/prepare-web.sh
|
||||||
- name: Build Release Web
|
- name: Build Release Web
|
||||||
run: flutter build web --release --verbose --source-maps
|
run: flutter build web --release --verbose --source-maps
|
||||||
|
- name: Build Website
|
||||||
|
run: |
|
||||||
|
npx tailwindcss -o ./tailwind.css --minify
|
||||||
|
mv docs public
|
||||||
|
mv repo public || true
|
||||||
|
mv build/web/ public/web
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
personal_token: ${{ secrets.GITHUB_TOKEN }}
|
personal_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./build/web
|
publish_dir: ./public
|
||||||
publish_branch: gh-pages
|
publish_branch: gh-pages
|
||||||
4
.github/workflows/pull_request.yaml
vendored
4
.github/workflows/pull_request.yaml
vendored
|
|
@ -3,8 +3,8 @@ name: Pull Request Workflow
|
||||||
on: [pull_request]
|
on: [pull_request]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
FLUTTER_VERSION: '3.10.6'
|
FLUTTER_VERSION: ${{ secrets.FLUTTER_VERSION }}
|
||||||
JAVA_VERSION: '11.0'
|
JAVA_VERSION: ${{ secrets.JAVA_VERSION }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue