Skip to content

Deliver for env dev (on GitHub-hosted) #1

Deliver for env dev (on GitHub-hosted)

Deliver for env dev (on GitHub-hosted) #1

run-name: Deliver for env 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@v4
- uses: subosito/flutter-action@v2
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 --dart-define=FLAVOR=dev
- uses: actions/configure-pages@v5
if: ${{ inputs.upload }}
- name: Upload artifact
if: ${{ inputs.upload }}
uses: actions/upload-pages-artifact@v3
with:
path: build/web
- name: Deploy to GitHub Pages
if: ${{ inputs.upload }}
id: deployment
uses: actions/deploy-pages@v4
- id: app-token
uses: actions/create-github-app-token@v1
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@v2