|
1 | | -name: Deploy to GitHub Pages |
| 1 | +name: Deploy |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | 6 | - main |
6 | 7 | workflow_dispatch: |
7 | 8 | workflow_call: |
8 | 9 |
|
9 | | -permissions: |
10 | | - contents: write |
11 | | - |
12 | 10 | jobs: |
13 | | - deploy: |
| 11 | + build: |
| 12 | + permissions: |
| 13 | + contents: write |
14 | 14 | runs-on: ubuntu-latest |
15 | 15 | steps: |
16 | | - - name: Checkout 🛎️ |
| 16 | + - name: Checkout |
17 | 17 | uses: actions/checkout@v4 |
18 | | - |
| 18 | + |
19 | 19 | - name: Setup Flutter |
20 | 20 | uses: subosito/flutter-action@v2 |
21 | 21 | with: |
@@ -43,17 +43,56 @@ jobs: |
43 | 43 | - name: Run Integration Tests |
44 | 44 | run: melos ci_integration_test --no-select |
45 | 45 |
|
46 | | - - name: Create .env.prod file |
47 | | - run: echo "${{ secrets.DOT_ENV_FILE }}" > .env.prod |
48 | | - |
49 | 46 | - name: Update GITHUB_RUN_NUMBER to version |
50 | 47 | run: melos update_version |
| 48 | + |
| 49 | + - name: Create .env.dev file |
| 50 | + run: echo "${{ secrets.DOT_ENV_DEV_FILE }}" > .env.dev |
| 51 | + |
| 52 | + - name: Build development |
| 53 | + run: melos build_dev |
| 54 | + |
| 55 | + - name: Publish to develop branch |
| 56 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 57 | + with: |
| 58 | + branch: develop |
| 59 | + folder: "./build/web" |
51 | 60 |
|
52 | | - - name: Build |
| 61 | + - name: Create .env.stg file |
| 62 | + run: echo "${{ secrets.DOT_ENV_STG_FILE }}" > .env.stg |
| 63 | + |
| 64 | + - name: Build staging |
| 65 | + run: melos build_stg |
| 66 | + |
| 67 | + - name: Publish to staging branch |
| 68 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 69 | + with: |
| 70 | + branch: staging |
| 71 | + folder: "./build/web" |
| 72 | + |
| 73 | + - name: Deploy staging to Netlify |
| 74 | + uses: nwtgck/actions-netlify@v3.0 |
| 75 | + with: |
| 76 | + publish-dir: "." |
| 77 | + production-branch: staging |
| 78 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + deploy-message: "Deploy from GitHub Actions" |
| 80 | + enable-pull-request-comment: false |
| 81 | + enable-commit-comment: true |
| 82 | + overwrites-pull-request-comment: true |
| 83 | + env: |
| 84 | + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} |
| 85 | + NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |
| 86 | + timeout-minutes: 1 |
| 87 | + |
| 88 | + - name: Create .env.prod file |
| 89 | + run: echo "${{ secrets.DOT_ENV_FILE }}" > .env.prod |
| 90 | + |
| 91 | + - name: Build production |
53 | 92 | run: melos build_prod |
54 | 93 |
|
55 | | - - name: Deploy 🚀 |
| 94 | + - name: Publish to production branch |
56 | 95 | uses: JamesIves/github-pages-deploy-action@v4 |
57 | 96 | with: |
58 | | - branch: gh-pages |
| 97 | + branch: production |
59 | 98 | folder: "./build/web" |
0 commit comments