denielchiang / line_reminder

Reminder using LINE Notify
1 stars 0 forks source link

Github Actions deployment issues #69

Closed denielchiang closed 2 months ago

denielchiang commented 4 months ago

This 2 files are not be found when deployed by Github Action.

denielchiang commented 4 months ago

https://community.fly.io/t/cannot-find-module-daisyui-in-elixir-phoenix-flyctl-launch/6267/2

denielchiang commented 4 months ago
#18 [builder 12/20] RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
#18 0.867 npm ERR! (intermediate value)(intermediate value)(intermediate value).then is not a function
#18 0.874 
#18 0.874 npm ERR! A complete log of this run can be found in:
#18 0.874 npm ERR!     /root/.npm/_logs/2024-05-10T13_50_27_668Z-debug.log
#18 ERROR: process "/bin/sh -c npm --prefix ./assets ci --progress=false --no-audit --loglevel=error" did not complete successfully: exit code: 1
------
 > [builder 12/20] RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error:
 ERR! (intermediate value)(intermediate value)(intermediate value).then is not a function
0.874 
0.874 npm ERR! A complete log of this run can be found in:
0.874 npm ERR!     /root/.npm/_logs/2024-05-10T13_50_27_668Z-debug.log
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c npm --prefix ./assets ci --progress=false --no-audit --loglevel=error" did not complete successfully: exit code: 1
Error: Process completed 
denielchiang commented 4 months ago

Try out 3 has no error during building. However the background image and font are still missing.

Screenshot 2024-05-10 at 10 23 59 PM
denielchiang commented 4 months ago

Try out 4 not works neither. Wild guess maybe just deploy from local first then try Github Actions next times?

denielchiang commented 4 months ago

From local to run fly deploy --remote-only then everything is good.

Screenshot 2024-05-10 at 10 48 40 PM
denielchiang commented 2 months ago

I found a discussion on Elixir forum that might works. Give a try on my local and remove all ESBuild customize settings like this post said. Take a try on Git Action deploy to Fly.

The solution I have come up with is to just skip all the ESBuild config stuff and manually convert the .ttf files to .woff2 and then just manually convert the .woff2 files to base64-encoded datauri strings that I manually include in my CSS file.

First, I use this tool to convert .ttf to .woff2: TTF to WOFF2 | CloudConvert 20

Then I use this tool to covert .woff2 to a base64-encoded datauri string: Woff2Base: Convert .woff2 to accurate Base64 css. 37

denielchiang commented 2 months ago

The font worked by this way. the bg.avif image left to solve.

I found a discussion on Elixir forum that might works. Give a try on my local and remove all ESBuild customize settings like this post said. Take a try on Git Action deploy to Fly.

The solution I have come up with is to just skip all the ESBuild config stuff and manually convert the .ttf files to .woff2 and then just manually convert the .woff2 files to base64-encoded datauri strings that I manually include in my CSS file. First, I use this tool to convert .ttf to .woff2: TTF to WOFF2 | CloudConvert 20 Then I use this tool to covert .woff2 to a base64-encoded datauri string: Woff2Base: Convert .woff2 to accurate Base64 css. 37

denielchiang commented 2 months ago

fixed!