fluffychat/.github/workflows/main_deploy.yaml

85 lines
2.8 KiB
YAML
Raw Normal View History

2023-07-14 09:50:39 +00:00
name: Main Deploy Workflow
on:
push:
branches:
- main
2023-07-14 11:19:13 +00:00
concurrency:
group: main_deploy
cancel-in-progress: true
2023-07-14 09:50:39 +00:00
jobs:
2023-07-14 09:57:30 +00:00
deploy_web:
2023-07-14 09:50:39 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2023-07-15 09:14:38 +00:00
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
2023-07-14 09:50:39 +00:00
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
2023-09-05 12:48:18 +00:00
cache: true
2023-07-14 09:57:30 +00:00
- name: Install dependencies
2023-07-14 10:00:01 +00:00
run: sudo apt-get update && sudo apt-get install nodejs -y
2023-07-14 09:50:39 +00:00
- run: flutter pub get
- name: Prepare web
2023-08-21 05:06:21 +00:00
run: ./scripts/prepare-web.sh
2023-07-30 11:08:03 +00:00
- name: Build Release Web
run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps --base-href "/web/"
2023-07-14 09:57:30 +00:00
- name: Build Website
run: |
2023-07-14 10:37:26 +00:00
cd docs && npx tailwindcss -o ./tailwind.css --minify && cd ..
2023-07-14 09:57:30 +00:00
mv docs public
mv repo public || true
mv build/web/ public/web
2023-07-29 08:27:22 +00:00
echo "fluffychat.im" > ./public/CNAME
2023-07-14 09:50:39 +00:00
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
2023-07-14 10:11:58 +00:00
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
2023-07-14 09:57:30 +00:00
publish_dir: ./public
2023-07-14 10:57:55 +00:00
publish_branch: gh-pages
deploy_playstore_internal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2023-07-15 09:14:38 +00:00
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
2023-07-14 10:57:55 +00:00
- uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
2023-09-05 12:48:18 +00:00
cache: true
2023-07-14 10:57:55 +00:00
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install Fastlane
run: gem install fastlane -NV
- name: Apply Google Services Patch
run: git apply ./scripts/enable-android-google-services.patch
- name: Remove Emoji Font
run: |
rm -rf fonts/NotoEmoji
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml
2023-07-14 10:57:55 +00:00
- run: flutter pub get
- name: Prepare Android Release Build
2023-07-15 00:37:55 +00:00
env:
FDROID_KEY: ${{ secrets.FDROID_KEY }}
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }}
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }}
run: ./scripts/prepare-android-release.sh
2023-07-14 10:57:55 +00:00
- name: Build Android Release
run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64
- name: Deploy Android Release
run: |
mkdir -p build/android
cp build/app/outputs/bundle/release/app-release.aab build/android/
cd android
bundle install
bundle update fastlane
bundle exec fastlane deploy_internal_test
cd ..