Skip to content

Commit

Permalink
feat auto deploy action
Browse files Browse the repository at this point in the history
  • Loading branch information
a3510377 committed Feb 18, 2024
1 parent c3d8e46 commit b1d239d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: deploy

on:
push:
branches: [main]
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js v20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn

- name: Install
run: yarn install

- name: Build
run: yarn build
env:
BASE_URL: /cloudtown-website
HOSTNAME: https://mc-cloud-town.github.io/

- name: deploy
run: |
cd dist
[ -f 404.html ] || ln -s index.html 404.html
if [ "none" != "$cname" ]; then echo "$cname" > CNAME; fi
- name: Fix permissions
run: |
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './dist'
3 changes: 1 addition & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import 'antd/dist/reset.css';
import { RouteRecord, ViteReactSSG } from 'vite-react-ssg';
import getStyledComponentsCollector from 'vite-react-ssg/style-collectors/styled-components';
import { lazy } from 'react';

import { Layout } from './Layout';
import { lazy } from 'react';
// import NotFoundPage from './pages/NotFoundPage.tsx';

const routes: RouteRecord[] = [
{
Expand Down

0 comments on commit b1d239d

Please sign in to comment.