DEV Community

Cover image for Adding Deploy to DO button (Also found some bug)
Chomtana
Chomtana

Posted on

Adding Deploy to DO button (Also found some bug)

Add .do/deploy.template.yaml

I copy template from tutorial and add build_command and output_dir field

spec:
  name: chomtana-portfolio
  static_sites:
  - git:
      branch: master
      repo_clone_url: https://github.com/Chomtana/personal-site
    name: chomtana-portfolio
    build_command: yarn export
    output_dir: __sapper__/export
Enter fullscreen mode Exit fullscreen mode

Add Deploy to DigitalOcean button

Add these code to Readme.md

[![Deploy to DO](https://www.deploytodo.com/do-btn-blue.svg)](https://cloud.digitalocean.com/apps/new?repo=https://github.com/Chomtana/personal-site/tree/master)
Enter fullscreen mode Exit fullscreen mode

What is the bug?

The bug is the output_dir command is not working as you can see in these screenshot it failed to build because output_dir is not set. But I have checked that it has been set.

Deploy failed

No Output dir

Hotfix

We temporary fix this by adding cp -r __sapper__/export public command to build command in order to copy static site output from __sapper__/export to public folder

Then deployment successful!

Alt Text

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay