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 Flutter Web App to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.26.0-0.1.pre' # 원하는 Flutter 버전으로 변경 | |
channel: beta # 채널도 beta로 설정 | |
- name: Install Dependencies | |
run: flutter pub get | |
- name: Create lib/api_key.dart with Kakao API Keys | |
run: | | |
echo "String kakaoNativeAppKey = '${{ secrets.KAKAO_NATIVE_APP_KEY }}';" > lib/api_key.dart | |
echo "String kakaoJavascriptKey = '${{ secrets.KAKAO_JAVASCRIPT_KEY }}';" >> lib/api_key.dart | |
- name: Build Web | |
run: flutter build web --release | |
- name: Add .nojekyll | |
run: echo > build/web/.nojekyll | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.MY_SECRET_KEY_NAME }} # repository에서 사용할 시크릿 키 이름 | |
publish_dir: build/web | |
publish_branch: gh-pages | |
cname: tradule.com |