Skip to content

Commit

Permalink
ci: Add delivery workflow for dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
yorifuji committed Jun 17, 2024
1 parent 2a4e86a commit 4fcfc31
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/deliver-env-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
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

0 comments on commit 4fcfc31

Please sign in to comment.