Upgrade dependencies #238
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: XMUX Web | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- .github/workflows/web.yaml | |
- lib/** | |
- web/** | |
- pubspec.yaml | |
- pubspec.lock | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Build | |
run: | | |
FLUTTER_BUILD_NUMBER=$(git rev-list --count HEAD) | |
GIT_DESC=$(git describe --tags) | |
if [[ $GIT_DESC =~ v([0-9]+)\.([0-9]+)\.([0-9]+)-([0-9]+)-g[a-f0-9]+ ]]; then | |
FLUTTER_BUILD_NAME="${BASH_REMATCH[1]}.$((BASH_REMATCH[2]+1)).${BASH_REMATCH[3]}" | |
else | |
FLUTTER_BUILD_NAME="0.0.1" | |
fi | |
echo $CONFIG_ENV | base64 -d > .env | |
flutter build web \ | |
--release \ | |
--build-name=$FLUTTER_BUILD_NAME \ | |
--build-number=$FLUTTER_BUILD_NUMBER \ | |
--dart-define-from-file=.env \ | |
--source-maps | |
env: | |
CONFIG_ENV: ${{ secrets.CONFIG_ENV }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: XMUX-Web | |
path: build/web | |
DeployGithubStatic: | |
runs-on: ubuntu-latest | |
needs: Build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: XMUX-Web | |
path: XMUX-Web | |
- name: Deploy to Github Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
deploy_key: ${{ secrets.DEPLOY_STATIC }} | |
external_repository: XMUMY/static | |
publish_branch: app-web | |
publish_dir: ./XMUX-Web | |
DeployFirebase: | |
runs-on: ubuntu-latest | |
needs: Build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: XMUX-Web | |
path: XMUX-Web | |
- name: Deploy to Firebase | |
uses: w9jds/[email protected] | |
with: | |
args: deploy --only hosting:xmux-web | |
env: | |
PROJECT_ID: xmux-app | |
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} |