Skip to content

Commit

Permalink
Merge pull request #5 from ymat19/feat/add-demo-page
Browse files Browse the repository at this point in the history
Feat/add demo page
  • Loading branch information
ymat19 authored Jan 29, 2025
2 parents 4ac3faa + 40fe94f commit ce5f7fc
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"about": "当サイトについて",
"api_endpoint_url": "api_gateway_endpoint",
"contact_email": "hoge@hoge",
"contact_x": "@hoge",
"about": "デモページです",
"api_endpoint_url": "none",
"contact_email": "none",
"contact_x": "none",
"license_notice": "著作注釈",
"technology_about": "当サイトのフロントエンドは、以下のオープンソースソフトウェア(OSS)によって支えられています。これらの素晴らしいプロジェクトに深く感謝いたします。\n\n- React\n- chakra-ui\n- emotion\n- react-iconsn\n",
"title": "website_title",
"work_urls": "作品URL"
"title": "デモページ",
"work_urls": "none"
}
52 changes: 52 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:

# Allows you to run this workflow manually from the Actions tab
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:
# Single deploy job since we're just deploying
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
uses: actions/setup-node@v4
with:
node-version: 23
- name: Install dependencies
working-directory: src/front/vite-project
run: npm install
- name: Copy DemoData
run: mkdir ./src/front/vite-project/public && cp ./.github/demoData/front_config.json.demo ./src/front/vite-project/public/front_config.json
- name: Build project
working-directory: src/front/vite-project
run: npm run build -- --mode demo --base /$(basename ${{ github.repository }})/
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './src/front/vite-project/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
18 changes: 18 additions & 0 deletions src/front/vite-project/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/front/vite-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"devDependencies": {
"@eslint/js": "^9.13.0",
"@types/crypto-js": "^4.2.2",
"@types/node": "^22.10.7",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
Expand Down
2 changes: 1 addition & 1 deletion src/front/vite-project/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const App: React.FC = () => {
useEffect(() => {
const loadConfig = async () => {
try {
const response = await fetch("front_config.json");
const response = await fetch(`${import.meta.env.BASE_URL === '/' ? '' : import.meta.env.BASE_URL}/front_config.json`);
if (!response.ok) {
throw new Error(`Failed to fetch: ${response.statusText}`);
}
Expand Down

0 comments on commit ce5f7fc

Please sign in to comment.