-
Notifications
You must be signed in to change notification settings - Fork 7
62 lines (57 loc) · 1.68 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Deploy
on:
workflow_dispatch:
push:
branches: [main]
concurrency:
group: "deploy"
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
- name: cache flutter
uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ hashFiles('**/.fvm/fvm_config.json') }}
path: .fvm/cache
- name: add brew to $PATH
run: |
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
- name: fvm install
run: |
brew tap leoafarias/fvm
brew install fvm
- name: flutter install
run: |
fvm config --cache-path .fvm/cache
fvm install
- name: update base_url
working-directory: 'example/web'
run: |
sed -i 's,base_url,https://flutter-seo.netlify.app,g' robots.txt
sed -i 's,base_url,https://flutter-seo.netlify.app,g' sitemap.xml
- name: flutter build
run: |
cd example
fvm config --cache-path ../.fvm/cache
fvm flutter pub get
fvm flutter build web --wasm --release
- name: deploy to netlify
uses: nwtgck/[email protected]
with:
publish-dir: 'example/build/web'
production-deploy: true
deploy-message: "Deploy from GitHub Actions"
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1