Skip to content

Commit

Permalink
switch to the vite sample workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanaem committed Mar 4, 2024
1 parent d3a6a4f commit bf61845
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# From https://vitejs.dev/guide/static-deploy#github-pages
name: deploy

on:
Expand All @@ -6,30 +7,45 @@ on:
- maint-41
workflow_dispatch:

# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up node env
uses: actions/[email protected]
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18

cache: 'npm'
- name: Create .env file
run: |
echo -e "NB_API_QUERY_URL=${{ vars.NB_API_QUERY_URL }}\nNB_IS_FEDERATION_API=${{ vars.NB_IS_FEDERATION_API }}" > .env
- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
# Upload dist repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 3 additions & 1 deletion src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import { StyledEngineProvider } from '@mui/material/styles';
import App from './App';
import './index.css';

const baseURL = import.meta.env.BASE_URL || '/';

const router = createBrowserRouter([
{
path: '/',
path: baseURL,
element: <App />,
},
]);
Expand Down

0 comments on commit bf61845

Please sign in to comment.