Skip to content

Commit

Permalink
Update prod to use SSG
Browse files Browse the repository at this point in the history
  • Loading branch information
samtay committed Sep 26, 2024
1 parent 2fe0b43 commit 5a9561b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,26 +59,26 @@ jobs:

# Install the Dioxus CLI
- name: Install Dioxus
# run: cargo binstall dioxus-cli -y --force
run: cargo install --git https://github.com/DioxusLabs/dioxus.git dioxus-cli --locked
run: cargo install --git https://github.com/DioxusLabs/dioxus.git --rev 87c2f64f134756578f6cf9e12fd085b9bb03c5c7 dioxus-cli --locked

# Build our Dioxus app in release.
- name: Build app
working-directory: app
run: dx build --release --platform web --features web
run: dx clean ; dx build --profile release --platform static-generation --features static-generation

# Fixup index.html (see https://github.com/DioxusLabs/dioxus/issues/2847)
- name: Fixup index.html
- name: Fixup build output
run: |
cd dist
for f in *.css; do
sed -i "/<\/head>/i <link rel=\"stylesheet\" href=\"/$(basename "$f")\">" index.html
done
./dist/birdtalk
cp -r ./static/* ./dist/public
cd dist/public
sed -i 's/<html>/<html lang="en">/' index.html
sed -i 's/<html>/<html lang="en">/' birds/index.html
sed -i 's/<html>/<html lang="en">/' play/index.html
# Create our required `404.html` page.
- name: Create 404.html
run: cp dist/index.html dist/404.html
run: cp dist/public/index.html dist/public/404.html

- uses: supabase/setup-cli@v1
with:
Expand All @@ -93,6 +93,6 @@ jobs:
uses: JamesIves/[email protected]
with:
branch: static-production # The branch we have GitHub pages setup in.
folder: dist # The folder we want to copy to the `gh-pages` branch.
folder: dist/public # The folder we want to copy to the `gh-pages` branch.
target-folder: . # The destination we want our files copied to. In this case, we want them to be a the root level.
clean: true

0 comments on commit 5a9561b

Please sign in to comment.