Skip to content

Merge pull request #1017 from pangeachat/xp-fix #654

Merge pull request #1017 from pangeachat/xp-fix

Merge pull request #1017 from pangeachat/xp-fix #654

Workflow file for this run

name: Main Deploy Workflow
on:
push:
branches:
- main
workflow_dispatch:
env:
WEB_APP_ENV: ${{ vars.WEB_APP_ENV }}
jobs:
# switch-branch:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout main branch
# uses: actions/checkout@v3
# - name: Checkout different branch
# run: git checkout development
build_web:
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Remove Emoji Font
run: |
rm -rf fonts/NotoEmoji
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml
- run: flutter pub get
- name: Prepare web
run: ./scripts/prepare-web.sh
- name: Build Release Web
run: ./scripts/build-web.sh
- name: Upload files
uses: actions/upload-artifact@v3
with:
name: web
path: build/web
deploy_web:
runs-on: ubuntu-latest
needs: build_web
environment: staging
steps:
- name: Download web
uses: actions/download-artifact@v3
with:
name: web
path: build/web
- name: Update Website files
run: |
mv build/web public
touch public/.env
echo "$WEB_APP_ENV" >> public/.env
cp public/.env public/assets/.env
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
publish_dir: ./public
publish_branch: gh-pages
cname: app.staging.pangea.chat
update_sentry:
runs-on: ubuntu-latest
needs: build_web
environment: staging
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_RELEASE: ${{ github.sha }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
steps:
- uses: actions/checkout@v4
- run: cat .github/workflows/versions.env >> $GITHUB_ENV
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: Download web
uses: actions/download-artifact@v3
with:
name: web
path: build/web
- name: Update packages
run: flutter pub get
- name: Update sentry
run: flutter packages pub run sentry_dart_plugin