Deliver for dev (on GitHub-hosted) #10
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
name: 05 Deliver for development | |
run-name: Deliver for dev ${{ (vars.RUNS_ON_SELF_HOSTED == null && '(on GitHub-hosted)') || '(on self-hosted)' }} | |
on: | |
workflow_dispatch: | |
inputs: | |
upload: | |
description: 'Upload' | |
type: boolean | |
default: true | |
workflow_call: | |
inputs: | |
upload: | |
description: 'Upload' | |
type: boolean | |
default: true | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
web: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
environment: | |
name: development | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 # v2.16.0 | |
with: | |
flutter-version: ${{ (vars.FLUTTER_VERSION != null && vars.FLUTTER_VERSION) || '' }} | |
channel: stable | |
cache: ${{ (vars.RUNS_ON_SELF_HOSTED == null && true) || false }} | |
- run: make build-runner | |
- run: flutter pub get | |
- name: flutterfire configure | |
env: | |
FIREBASE_ADMIN_SERVICE_ACCOUNT_JSON_BASE64: ${{ secrets.FIREBASE_ADMIN_SERVICE_ACCOUNT_JSON_BASE64 }} | |
run: | | |
which firebase || curl -sL https://firebase.tools | bash | |
dart pub global activate flutterfire_cli 1.0.1-dev.4 | |
echo -n "$FIREBASE_ADMIN_SERVICE_ACCOUNT_JSON_BASE64" | base64 --decode > ${{ runner.temp }}/firebase_admin_service_account.json | |
GOOGLE_APPLICATION_CREDENTIALS=${{ runner.temp }}/firebase_admin_service_account.json make flutterfire-dev | |
- run: flutter build web --release --dart-define=FLAVOR=dev --web-renderer canvaskit | |
- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 | |
if: ${{ inputs.upload }} | |
- name: Upload artifact | |
if: ${{ inputs.upload }} | |
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 | |
with: | |
path: build/web | |
- name: Deploy to GitHub Pages | |
if: ${{ inputs.upload }} | |
id: deployment | |
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 | |
- id: app-token | |
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 | |
with: | |
app-id: ${{ secrets.APPS_APP_ID }} | |
private-key: ${{ secrets.APPS_PRIVATE_KEY }} | |
# Upload asset files to a GitHub Release if event is triggered by a push tag | |
- name: Upload asset files to a GitHub Release | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && inputs.upload}} | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
run: | | |
tar cvzf web.tar.gz build/web | |
gh release upload ${{ github.ref_name }} web.tar.gz --clobber | |
action-timeline: | |
needs: [web] | |
if: ${{ !cancelled() && github.event.workflow == '.github/workflows/deliver-dev.yml' }} | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: Kesin11/actions-timeline@3046833d9aacfd7745c5264b7f3af851c3e2a619 # v2.2.1 |