Skip to content

EF-81: Open map for 3-party direction #135

EF-81: Open map for 3-party direction

EF-81: Open map for 3-party direction #135

Workflow file for this run

on:
pull_request:
env:
Flutter_Version: 3.24.2
name: Deploy on Github pages
jobs:
deploy-preview:
name: Deploy preview versions on pull requests
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions:
deployments: write
pull-requests: write
contents: write
environment:
name: PR-${{ github.event.pull_request.number }}
url: ${{ steps.configure.outputs.url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.Flutter_Version }}
channel: 'stable'
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}"
- name: Create .env file
run: |
echo "" > .env
- name: Build Web version
env:
FOLDER: ${{ github.event.pull_request.number }}
run: |
flutter config --enable-web
flutter clean
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
flutter build web --release --verbose --source-maps --dart-define=STRIPE_PUBLISHABLE_KEY=${{secrets.STRIPE_PUBLISHABLE_KEY}} --dart-define=IS_RELEASE=FALSE --dart-define=PULL_REQUEST_NUMBER=${{ github.event.pull_request.number }} --dart-define=MAPBOX_URL_TEMPLATE=${{ secrets.MAPBOX_URL_TEMPLATE }} --dart-define=SUPABASE_PROJECT_URL=${{ secrets.SUPABASE_PROJECT_URL }} --dart-define=SUPABASE_ANON_KEY=${{ secrets.SUPABASE_ANON_KEY }} --base-href="/${GITHUB_REPOSITORY##*/}/$FOLDER/"
- name: Configure environments
id: configure
env:
FOLDER: ${{ github.event.pull_request.number }}
run: |
echo "URL=https://$GITHUB_REPOSITORY_OWNER.github.io/${GITHUB_REPOSITORY##*/}/$FOLDER" >> $GITHUB_OUTPUT
- name: Deploy on Github pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/web
keep_files: true
destination_dir: ${{ github.event.pull_request.number }}
- name: Find deployment comment
uses: peter-evans/find-comment@v3
id: fc
with:
comment-author: 'github-actions[bot]'
issue-number: ${{ github.event.pull_request.number }}
body-includes: 'This PR has been deployed to'
- name: Create or update deployment comment
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
This PR has been deployed to ${{ steps.configure.outputs.URL }}
edit-mode: replace
- name: Remove .env file
run: |
rm .env