fixed ci/cd

added config.json
This commit is contained in:
SnippetsX 2024-11-19 20:08:06 +03:00
parent cf853ced14
commit 4417df86a2
4 changed files with 17 additions and 10 deletions

View File

@ -24,14 +24,14 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: npm install run: npm install
- name: Build app name: Export version from metadata.json
run: npm run build
- name: Export version from metadata.json
run: | run: |
VERSION=$(jq -r '"\(.buildMajor).\(.buildMinor).\(.buildRevision)-\(.buildTag)"' src/metadata.json) VERSION=$(jq -r '"\(.buildMajor).\(.buildMinor).\(.buildRevision)-\(.buildTag)"' src/metadata.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build app
run: npm run build
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:

View File

@ -23,11 +23,11 @@ import AccountCircleIcon from '@mui/icons-material/AccountCircleOutlined';
import { ThemeProvider } from '@mui/material/styles'; import { ThemeProvider } from '@mui/material/styles';
import theme from '../theme'; import theme from '../theme';
import deleteToken from '../core/deleteToken'; import deleteToken from '../core/deleteToken';
import config from '../config.json';
const drawerWidth = 240; const drawerWidth = 240;
export default function SettingsMain() { export default function SettingsMain() {
const [open, setOpen] = useState(false);
const [anchorEl, setAnchorEl] = useState(null); const [anchorEl, setAnchorEl] = useState(null);
const openMenu = Boolean(anchorEl); const openMenu = Boolean(anchorEl);
@ -112,10 +112,12 @@ export default function SettingsMain() {
<PeopleIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <PeopleIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
<ListItemText primary="Access lists" sx={{ color: '#FFFFFF' }} /> <ListItemText primary="Access lists" sx={{ color: '#FFFFFF' }} />
</ListItem> </ListItem>
<ListItem button key="Debug"> {config.developerMode && (
<BarChartIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/> <ListItem button key="Debug">
<ListItemText primary="Debug" sx={{ color: '#FFFFFF' }} /> <BarChartIcon sx={{ marginRight: 2, color: '#FFFFFF' }}/>
</ListItem> <ListItemText primary="Debug" sx={{ color: '#FFFFFF' }} />
</ListItem>
)}
</List> </List>
</Drawer> </Drawer>

5
src/config.json Normal file
View File

@ -0,0 +1,5 @@
{
"developerMode": false,
"backendUrl": "https://api.example.com"
}

View File

@ -1 +1 @@
{"buildMajor":1,"buildMinor":0,"buildRevision":10,"buildTag":"DEV"} {"buildMajor":1,"buildMinor":0,"buildRevision":11,"buildTag":"DEV"}