Skip to content

ci: try to use fvm container #37

ci: try to use fvm container

ci: try to use fvm container #37

Workflow file for this run

name: Deploy app
on:
push:
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
container: leoafarias/fvm
steps:
- name: configure enviroment
uses: actions/checkout@v4
# - name: Get Flutter version by FVM
# uses: kuhnroyal/flutter-fvm-config-action@v3
# with:
# path: '.fvmrc'
- name: get flutter dependencies
run: flutter pub get
- name: Verify formated files
run: dart format . --set-exit-if-changed
- name: code analyze
run: flutter analyze
- name: build web app
run: flutter build web
- uses: actions/upload-artifact@v4
with:
name: web-app
path: build/web/
retention-days: 1
preview:
if: ${{ github.ref == 'refs/heads/main' }}
needs: build
name: Deploy preview web
runs-on: ubuntu-latest
steps:
- name: Configure enviroment
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: web-app
path: build/web
- name: HTML/CSS/JS Minifier
uses: docker://devatherock/minify-js:2.0.0
with:
directory: 'build/web'
add_suffix: false
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DEANDREAMATIAS_WEBSITE }}'
projectId: deandreamatias-website
channelId: preview
deployment:
if: ${{ github.ref_type == 'tag' }}
needs: build
name: Deploy web
runs-on: ubuntu-latest
steps:
- name: Configure enviroment
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: web-app
path: build/web
- name: HTML/CSS/JS Minifier
uses: docker://devatherock/minify-js:2.0.0
with:
directory: 'build/web'
add_suffix: false
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DEANDREAMATIAS_WEBSITE }}'
projectId: deandreamatias-website
channelId: live
- name: Release
uses: softprops/action-gh-release@v2