Deployment

Deploy your Doks site to Netlify or any other static web host.

On this page

👉

Make sure to set baseURL in ./config/production/config.toml to the URL of your Doks website in production.

Deploy to Netlify

See Netlify.

Deploy to GitHub Pages

💡

Check the example repo showing how to publish to GitHub Pages.

  1. Add .github/workflows/deploy-github.yml:
  1. # Deploy your Hyas site to GitHub Pages
  2. name: GitHub Pages
  3. on:
  4. push:
  5. branches:
  6. - master
  7. jobs:
  8. deploy:
  9. runs-on: ubuntu-20.04
  10. steps:
  11. - uses: actions/checkout@v2
  12. - uses: actions/setup-node@v2
  13. with:
  14. node-version: '16'
  15. cache: 'npm'
  16. - name: Install dependencies
  17. run: npm install
  18. - name: Check for linting errors
  19. run: npm test
  20. - name: Build production website
  21. run: npm run build
  22. - name: Deploy to GitHub Pages
  23. uses: peaceiris/actions-gh-pages@v3
  24. with:
  25. github_token: ${{ secrets.GITHUB_TOKEN }}
  26. publish_dir: ./public
  1. Click on the Actions tab of your GitHub repo and wait for the action to finish successfully (after approximately 30 seconds).

Select branch

  1. Go to the Settings tab of your GitHub repo, and next to the Pages section. Select branch gh-pages and click Save.
  2. Copy the Your site is published at URL and paste it as baseurl in ./config/production/config.toml.
  3. Set canonifyURLs = true in ./config/production/config.toml.
  4. Push the changes to GitHub and wait for the action to finish successfully (after approximately 30 seconds).
  5. That’s it. After a minute or so, you site is available at the Your site is published at URL.

Now, after every push to the master branch, your site will be updated — automatically.

Deploy to other hosts

See the Hugo Docs: Hosting & Deployment.