HOTFIX Build vodozemac on runner #3684
This file contains hidden or 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
on: | |
pull_request: | |
env: | |
FLUTTER_VERSION: 3.32.8 | |
name: Deploying 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: Setup Rust | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install yq | |
run: sudo apt-get update && sudo apt-get install -y yq | |
- name: Cache Cargo | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
${{ env.VODOZEMAC_PATH }}/target | |
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-debug- | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Prepare web vodozemac | |
run: ./scripts/prepare-web.sh | |
- name: Build Web version | |
env: | |
FOLDER: ${{ github.event.pull_request.number }} | |
TWAKE_PREVIEW_CONFIG: ${{ secrets.TWAKE_PREVIEW_CONFIG }} | |
run: | | |
flutter config --enable-web | |
flutter clean | |
flutter pub get | |
flutter pub run build_runner build -d | |
flutter build web --release --verbose --source-maps --base-href="/${GITHUB_REPOSITORY##*/}/$FOLDER/" | |
echo "$TWAKE_PREVIEW_CONFIG" | yq '.issue_id = strenv(FOLDER)' > ./build/web/config.json | |
- 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 to 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 |