|
1 |
| -name: Build & deploy |
| 1 | +name: Build |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
5 | 5 | branches:
|
6 | 6 | - master
|
7 | 7 |
|
8 | 8 | jobs:
|
9 |
| - build-and-push-container: |
10 |
| - name: Build and Push Thilo Container |
11 |
| - runs-on: ubuntu-latest |
12 |
| - |
13 |
| - steps: |
14 |
| - - name: Check out the repo |
15 |
| - uses: actions/checkout@v4 |
16 |
| - - name: Set up QEMU |
17 |
| - uses: docker/setup-qemu-action@v3 |
18 |
| - - name: Set up Docker Buildx |
19 |
| - uses: docker/setup-buildx-action@v3 |
20 |
| - - name: Login to GitHub Container Registry |
21 |
| - uses: docker/login-action@v3 |
22 |
| - with: |
23 |
| - registry: ghcr.io |
24 |
| - username: ${{ github.actor }} |
25 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
26 |
| - - name: Build docker container |
27 |
| - uses: docker/build-push-action@v5 |
28 |
| - with: |
29 |
| - context: ./ |
30 |
| - load: true |
31 |
| - tags: | |
32 |
| - ghcr.io/scout-ch/thilo/thilo_frontend:latest |
33 |
| - - name: Push docker container |
34 |
| - uses: docker/build-push-action@v5 |
35 |
| - with: |
36 |
| - push: true |
37 |
| - context: ./ |
38 |
| - tags: | |
39 |
| - ghcr.io/scout-ch/thilo/thilo_frontend:latest |
40 |
| -
|
41 |
| - buildGHPages: |
42 |
| - name: Build Thilo App GHPages |
43 |
| - runs-on: ubuntu-latest |
44 |
| - env: |
45 |
| - REACT_APP_PUBLIC_URL: /thilo/ |
46 |
| - |
47 |
| - steps: |
48 |
| - - uses: actions/checkout@v4 |
49 |
| - - uses: pnpm/action-setup@v4 |
50 |
| - name: Install pnpm |
51 |
| - with: |
52 |
| - version: 8 |
53 |
| - run_install: false |
54 |
| - - name: Install Node.js |
55 |
| - uses: actions/setup-node@v4 |
56 |
| - with: |
57 |
| - node-version: 20 |
58 |
| - cache: "pnpm" |
59 |
| - - run: pnpm install |
60 |
| - - name: Create backend export |
61 |
| - run: node src/scripts/strapiToJson.js |
62 |
| - - run: pnpm run build |
63 |
| - |
64 |
| - - uses: actions/upload-artifact@v4 |
65 |
| - with: |
66 |
| - name: build-cache-gp |
67 |
| - path: ./build |
68 |
| - |
69 |
| - deployGHPages: |
70 |
| - name: Deploy Thilo App GHPages |
71 |
| - needs: buildGHPages |
72 |
| - runs-on: ubuntu-latest |
73 |
| - if: github.ref == 'refs/heads/master' |
74 |
| - |
75 |
| - steps: |
76 |
| - - uses: actions/download-artifact@v4 |
77 |
| - with: |
78 |
| - name: build-cache-gp |
79 |
| - path: ./build |
80 |
| - - uses: peaceiris/actions-gh-pages@v4 |
81 |
| - with: |
82 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
83 |
| - publish_dir: ./build |
84 |
| - |
85 |
| - buildProd: |
| 9 | + build: |
86 | 10 | name: Build Thilo App Prod
|
87 | 11 | runs-on: ubuntu-latest
|
88 | 12 | env:
|
89 | 13 | REACT_APP_PUBLIC_URL: /
|
90 |
| - BACKEND_URL: ${{ secrets.BACKEND_URL }} |
| 14 | + BACKEND_URL: https://thilo-backend.herokuapp.com |
91 | 15 |
|
92 | 16 | steps:
|
93 | 17 | - uses: actions/checkout@v4
|
94 |
| - - uses: pnpm/action-setup@v4 |
95 |
| - name: Install pnpm |
96 |
| - with: |
97 |
| - version: 8 |
98 |
| - run_install: false |
99 | 18 | - name: Install Node.js
|
100 | 19 | uses: actions/setup-node@v4
|
101 | 20 | with:
|
102 | 21 | node-version: 20
|
103 |
| - cache: "pnpm" |
104 |
| - - run: pnpm install |
| 22 | + - run: npm install |
105 | 23 | - name: Create backend export
|
106 | 24 | run: node src/scripts/strapiToJson.js
|
107 |
| - - run: pnpm run build |
| 25 | + - run: npm run build |
108 | 26 | - run: echo "$(envsubst < build/index.html)" > build/index.html
|
109 | 27 |
|
110 | 28 | - uses: actions/upload-artifact@v4
|
111 | 29 | with:
|
112 | 30 | name: build-cache-prod
|
113 | 31 | path: ./build
|
114 |
| - |
115 |
| - deployProd: |
116 |
| - name: Deploy Thilo App Prod |
117 |
| - needs: buildProd |
118 |
| - runs-on: ubuntu-latest |
119 |
| - if: github.ref == 'refs/heads/master' |
120 |
| - |
121 |
| - steps: |
122 |
| - - uses: actions/download-artifact@v4 |
123 |
| - with: |
124 |
| - name: build-cache-prod |
125 |
| - path: ./build |
126 |
| - - name: 📂 Sync files |
127 |
| - uses: SamKirkland/[email protected] |
128 |
| - with: |
129 |
| - server: ${{ secrets.FTP_SERVER }} |
130 |
| - username: ${{ secrets.FTP_USER }} |
131 |
| - password: ${{ secrets.FTP_PASSWORD }} |
132 |
| - protocol: ftps |
133 |
| - server-dir: /webroot/ROOT/ |
134 |
| - local-dir: ./build/ |
135 |
| - exclude: | |
136 |
| - **/.devcontainer* |
137 |
| - **/.devcontainer*/** |
138 |
| - **/.git* |
139 |
| - **/.git*/** |
140 |
| - **/.github* |
141 |
| - **/.github*/** |
0 commit comments