Skip to content

Install the CodeSee workflow. #18

Install the CodeSee workflow.

Install the CodeSee workflow. #18

Workflow file for this run

name: Test & Deploy PR
on: [pull_request]
jobs:
job:
name: Test & deploy
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'beta'
- name: Prepare required secret files
run: |
echo -n "${{ secrets.ANILIST_CONSTS_DART }}" | base64 --decode > ./lib/consts/anilist_consts.dart
- name: Get dependencies
run: flutter pub get
- name: Install flutter_gen
run: dart pub global activate flutter_gen
- name: Run code generation
run: flutter pub run build_runner build
- name: Get the number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Run tests
run: flutter test -j ${{ steps.cpu-cores.outputs.count }}
- name: Build
run: flutter build web --release
- name: Compress build
run: zip -r $GITHUB_WORKSPACE/aoba_web.zip .
working-directory: build/web
- name: Upload build artifacts
id: upload_artifacts
uses: actions/upload-artifact@v3
with:
name: aoba_web.zip
path: ./aoba_web.zip
- name: Deploy to Firebase Hosting
uses: FirebaseExtended/action-hosting-deploy@v0
with:
projectId: ${{ secrets.FIREBASE_APP_ID }}
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_HOSTING_CREDENTIALS }}
expires: 30d