Deliver for dev (on GitHub-hosted) #5
Workflow file for this run
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: github-pages | |
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 | |
- 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@31c86eb3b33c9b601a1f60f98dcbfd1d70f379b4 # v1.10.3 | |
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@da70beff098ff89b15d279e8bf2f60519a8dadd7 # v2.2.0 |