Merge pull request #821 from YumNumm/dependabot/github_actions/depend… #143
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: Deploy Web (Widgetbook) | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
deployments: write | |
steps: | |
# https://github.com/actions/checkout | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up ssh | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSH_ID_ED25519 }}" | base64 -d > ~/.ssh/id_ed25519 | |
chmod 700 ~/.ssh/id_ed25519 | |
eval $(ssh-agent -s) | |
echo "Host github.com \n\tIdentityFile ~/.ssh/id_ed25519\n\tUser git\n\tIdentityiesOnly yes" >> ~/.ssh/config | |
ssh-keyscan -H github.com >> ~/.ssh/known_hosts | |
- uses: kuhnroyal/flutter-fvm-config-action@v2 | |
id: fvm-config-action | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }} | |
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }} | |
- name: Setup melos | |
run: | | |
ln -s $FLUTTER_ROOT .fvm/flutter_sdk | |
dart pub global activate melos | |
melos bootstrap | |
- name: build_runner | |
run: | | |
echo '${{ secrets.ENV }}' | base64 -d > app/.env | |
melos generate | |
- name: Build web | |
working-directory: app | |
run: flutter build web --release --wasm -t ./lib/widgetbook.dart | |
- name: Publish to Cloudflare Pages | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: 4270d8a14dfc1f866629099a788c93e2 | |
projectName: eqmonitor-widgetbook | |
directory: app/build/web | |
# Optional: Enable this if you want to have GitHub Deployments triggered | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
wranglerVersion: "3" |