forked from Tonnanto/flutter-bird
-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (56 loc) · 1.96 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
63
64
65
66
67
name: Deploy Netlify
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-deploy:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: subosito/[email protected]
with:
flutter-version: '3.22.2'
- name: Make env
working-directory: flutter_bird_app
run: |
touch env
echo WALLET_CONNECT_PROJECT_ID=${{secrets.WALLET_CONNECT_PROJECT_ID}} >> env
echo PRIVATE_KEY=${{secrets.PRIVATE_KEY}} >> env
- name: Show version
working-directory: flutter_bird_app
run: flutter --version
- name: Install packages
working-directory: flutter_bird_app
run: flutter pub get
- name: Build
working-directory: flutter_bird_app
run: |
flutter build web
mkdir -p build/web/assets
cp env build/web/assets
- name: Set GitHub Deployment Environment
id: github_deployment_environment
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then
echo "GITHUB_DEPLOYMENT_ENVIRONMENT=Netlify prd" >> "${GITHUB_OUTPUT}"
else
echo "GITHUB_DEPLOYMENT_ENVIRONMENT=Netlify Preview" >> "${GITHUB_OUTPUT}"
fi
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './flutter_bird_app/build/web'
production-branch: master
github-deployment-environment: ${{ steps.github_deployment_environment.outputs.GITHUB_DEPLOYMENT_ENVIRONMENT }}
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: ${{ github.event.head_commit.message || github.event.pull_request.title }}
alias: deploy-preview-${{ github.event.number }}
fails-without-credentials: true
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PAT }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}