Skip to content

Commit

Permalink
docs: Deploy live example app to GH pages (#1623)
Browse files Browse the repository at this point in the history
# Description

GitHub provides a workflow, to deploy Apps on their pages system. 
The url is https://bluefireteam.github.io/audioplayers/
On every push to main, the live example will be updated.
  • Loading branch information
Gustl22 committed Aug 31, 2023
1 parent b2d192e commit fe81f3b
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/build-example.yml
Expand Up @@ -44,6 +44,11 @@ on:
required: false
default: true
type: boolean
upload_pages_artifact:
description: 'Upload build artifact for GH pages'
required: false
default: false
type: boolean
workflow_call:
inputs:
flutter_version:
Expand Down Expand Up @@ -74,6 +79,10 @@ on:
required: false
default: true
type: boolean
upload_pages_artifact:
required: false
default: false
type: boolean

jobs:
web:
Expand All @@ -91,6 +100,11 @@ jobs:
- name: Example app - Build Web app
working-directory: ./packages/audioplayers/example
run: flutter build web
- name: Upload pages artifact
if: inputs.upload_pages_artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./packages/audioplayers/example/build/web

android:
runs-on: ubuntu-latest
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -3,11 +3,36 @@ on:
push:
branches:
- main
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
call-build-example:
uses: ./.github/workflows/build-example.yml
with:
upload_pages_artifact: true

call-test:
needs: call-build-example
uses: ./.github/workflows/test.yml

deploy-github-pages:
needs:
- call-build-example
- call-test
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 2 additions & 1 deletion getting_started.md
@@ -1,6 +1,7 @@
# Getting Started

This tutorial should help you get started with the audioplayers library, covering the basics but guiding you all the way through advanced features. For a more code-based approach, check the code for [our official example app](https://github.com/bluefireteam/audioplayers/tree/main/packages/audioplayers/example), that showcases every feature the library has to offer.
This tutorial should help you get started with the audioplayers library, covering the basics but guiding you all the way through advanced features.
You can also play around with our [official example app](https://bluefireteam.github.io/audioplayers/) and [explore the code](https://github.com/bluefireteam/audioplayers/tree/main/packages/audioplayers/example), that showcases every feature the library has to offer.

In order to install this package, add the [latest version](pub.dev/packages/audioplayers) of `audioplayers` to your `pubspec.yaml` file. This packages uses [the Federated Plugin](https://docs.flutter.dev/development/packages-and-plugins/developing-packages) guidelines to support multiple platforms, so it should just work on all supported platforms your app is built for without any extra configuration. You should not need to add the `audioplayers_*` packages directly.

Expand Down
3 changes: 3 additions & 0 deletions packages/audioplayers/README.md
Expand Up @@ -17,6 +17,7 @@
---

<a title="Sources" href="https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/lib/tabs/sources.dart"><img src="https://raw.githubusercontent.com/bluefireteam/audioplayers/main/images/screenshot_src.png" width="25%"/></a><a title="Controls" href="https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/lib/tabs/controls.dart"><img src="https://raw.githubusercontent.com/bluefireteam/audioplayers/main/images/screenshot_ctrl.png" width="25%"/></a><a title="Streams" href="https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/lib/tabs/streams.dart"><img src="https://raw.githubusercontent.com/bluefireteam/audioplayers/main/images/screenshot_stream.png" width="25%"/></a><a title="Audio Context" href="https://github.com/bluefireteam/audioplayers/blob/main/packages/audioplayers/example/lib/tabs/audio_context.dart"><img src="https://raw.githubusercontent.com/bluefireteam/audioplayers/main/images/screenshot_ctx.png" width="25%"/></a>
<p align="center"><i>Check out the live <a href="https://bluefireteam.github.io/audioplayers/">example app</a>.</i></p>

**Note**: all the docs are kept up to date to reflect the content of the current newest release. If you are looking for older information and guidance, please checkout the [tag](https://github.com/bluefireteam/audioplayers/tags) related to the version that you are looking for.

Expand All @@ -28,6 +29,8 @@ If you are interest in migrating major versions, please check the [changelog](CH
We tried to make audioplayers as simple to use as possible:

```dart
import 'package:audioplayers/audioplayers.dart';
// ...
final player = AudioPlayer();
await player.play(UrlSource('https://example.com/my-audio.wav'));
```
Expand Down
1 change: 1 addition & 0 deletions packages/audioplayers/example/lib/main.dart
Expand Up @@ -15,6 +15,7 @@ const defaultPlayerCount = 4;

typedef OnError = void Function(Exception exception);

/// The app is deployed at: https://bluefireteam.github.io/audioplayers/
void main() {
runApp(const MaterialApp(home: _ExampleApp()));
}
Expand Down

0 comments on commit fe81f3b

Please sign in to comment.