Skip to content

Commit 09cfd26

Browse files
authored
Merge pull request #271 from jimmylevell/master
Fix: Move back to NPM for working production builds
2 parents 934739b + 82add03 commit 09cfd26

File tree

2 files changed

+21
-141
lines changed

2 files changed

+21
-141
lines changed

.github/workflows/deploy.yml

+5-115
Original file line numberDiff line numberDiff line change
@@ -1,141 +1,31 @@
1-
name: Build & deploy
1+
name: Build
22

33
on:
44
push:
55
branches:
66
- master
77

88
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:
8610
name: Build Thilo App Prod
8711
runs-on: ubuntu-latest
8812
env:
8913
REACT_APP_PUBLIC_URL: /
90-
BACKEND_URL: ${{ secrets.BACKEND_URL }}
14+
BACKEND_URL: https://thilo-backend.herokuapp.com
9115

9216
steps:
9317
- uses: actions/checkout@v4
94-
- uses: pnpm/action-setup@v4
95-
name: Install pnpm
96-
with:
97-
version: 8
98-
run_install: false
9918
- name: Install Node.js
10019
uses: actions/setup-node@v4
10120
with:
10221
node-version: 20
103-
cache: "pnpm"
104-
- run: pnpm install
22+
- run: npm install
10523
- name: Create backend export
10624
run: node src/scripts/strapiToJson.js
107-
- run: pnpm run build
25+
- run: npm run build
10826
- run: echo "$(envsubst < build/index.html)" > build/index.html
10927

11028
- uses: actions/upload-artifact@v4
11129
with:
11230
name: build-cache-prod
11331
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*/**

package.json

+16-26
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
"version": "0.1.0",
99
"private": true,
1010
"dependencies": {
11-
"@primer/css": "^21.5.1",
12-
"@primer/octicons-react": "^19.12.0",
13-
"@primer/primitives": "^8.2.4",
11+
"@primer/css": "^21.3.6",
12+
"@primer/octicons-react": "^19.11.0",
13+
"@primer/primitives": "^8.2.3",
1414
"@primer/react": "^35.32.2",
15-
"@vitejs/plugin-react": "^4.3.3",
16-
"axios": "^1.7.7",
15+
"@vitejs/plugin-react": "^4.3.1",
16+
"axios": "^1.7.2",
1717
"classnames": "^2.5.1",
1818
"i18next": "^22.5.1",
1919
"i18next-browser-languagedetector": "^7.2.1",
@@ -24,23 +24,23 @@
2424
"react-i18next": "^12.3.1",
2525
"react-markdown": "^8.0.7",
2626
"react-quiz-component": "^0.5.1",
27-
"react-router": "^6.28.0",
28-
"react-router-dom": "^6.28.0",
27+
"react-router": "^6.24.1",
28+
"react-router-dom": "^6.24.1",
2929
"remark": "^14.0.3",
3030
"remark-gfm": "^3.0.1",
3131
"strip-markdown": "^5.0.1",
32-
"vite": "^4.5.5",
32+
"vite": "^4.5.3",
3333
"web-vitals": "^3.5.2"
3434
},
3535
"devDependencies": {
3636
"@craco/craco": "7.1.0",
37-
"@types/node": "^18.19.64",
38-
"@types/react": "^18.3.12",
39-
"@types/react-dom": "^18.3.1",
37+
"@types/node": "^18.19.39",
38+
"@types/react": "^18.3.3",
39+
"@types/react-dom": "^18.3.0",
4040
"@types/react-helmet": "^6.1.11",
4141
"@types/react-router-dom": "^5.3.3",
42-
"sass": "^1.80.7",
43-
"serve": "^14.2.4",
42+
"sass": "^1.77.8",
43+
"serve": "^14.2.3",
4444
"typescript": "^4.9.5",
4545
"vite-plugin-pwa": "^0.16.7"
4646
},
@@ -53,20 +53,10 @@
5353
"react-error-overlay": "6.0.9"
5454
},
5555
"eslintConfig": {
56-
"extends": [
57-
"react-app"
58-
]
56+
"extends": ["react-app"]
5957
},
6058
"browserslist": {
61-
"production": [
62-
">0.2%",
63-
"not dead",
64-
"not op_mini all"
65-
],
66-
"development": [
67-
"last 1 chrome version",
68-
"last 1 firefox version",
69-
"last 1 safari version"
70-
]
59+
"production": [">0.2%", "not dead", "not op_mini all"],
60+
"development": ["last 1 chrome version", "last 1 firefox version", "last 1 safari version"]
7161
}
7262
}

0 commit comments

Comments
 (0)