Skip to content

Commit

Permalink
ci: add deploy to gh pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AladdineDev committed Feb 5, 2024
1 parent 5edfcac commit 0640907
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3

- name: Setup Flutter
run: |
git clone https://github.com/flutter/flutter.git --depth 1 -b beta _flutter
echo "${GITHUB_WORKSPACE}/_flutter/bin" >> ${GITHUB_PATH}
- name: Install
run: |
flutter config --enable-web
flutter pub get
- name: Code generation
run: |
dart run build_runner build -d
dart run easy_localization:generate -S assets/translations -f json -O lib/src/localization/generated -o locale_json.g.dart
dart run easy_localization:generate -S assets/translations -f keys -O lib/src/localization/generated -o locale_keys.g.dart
- name: Build
run: flutter build web --web-renderer canvaskit --release --no-tree-shake-icons --base-href /${{github.event.repository.name}}/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/web
destination_dir: subdir
4 changes: 2 additions & 2 deletions assets/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
],
"links": [
{
"url": "https://aladdine.dev",
"display": "Inspired by Aladdine Abdou"
"url": "https://brittanychiang.com",
"display": "Inspired by Brittany Chiang"
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions assets/translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
],
"links": [
{
"url": "https://aladdine.dev",
"display": "Inspiré par Aladdine Abdou"
"url": "https://brittanychiang.com",
"display": "Inspiré par Brittany Chiang"
}
]
},
Expand Down

0 comments on commit 0640907

Please sign in to comment.