Git Product home page Git Product logo

yesod-heroku-example's Introduction

yesod-heroku-example

Minimal example of a pipeline for deploying Yesod to Heroku through CircleCI.

How it works?

When you push change to the repository, CircleCI builds yesod application, runs tests and pushes statically linked binary to the Heroku.

As the Yesod app is statically compiled resulting binary doesn't need any dependencies.

Required CircleCI Environment Variables

Environment variables you need to define in CircleCI project settings:

Do It Yourself Guide

  1. Create a minimal Yesod app tack new YOUR_APP_NAME yesod-minimal
  2. Update src/Main.hs to use port from the PORT env var (example)
  3. Create .circleci directory in the root of your project and add config.yml and setup-heroku.sh
  4. Create a Heroku project with null buildpack heroku create YOUR_PROJECT_NAME --buildpack http://github.com/ryandotsmith/null-buildpack.git
  5. Add Heroku remote to your project heroku git:remote -a YOUR_HEROKU_PROJECT_NAME
  6. Add Procfile with default web process pointing to binary which will be created durinng CircleCI build - dist/YOUR_APP_NAME (example)
  7. Push your changes to your project's repo (Github or Bitbucket will both work)
  8. Create new CircleCI project for project's repository and add required environment variables (HEROKU_PROJECT, HEROKU_LOGIN, HEROKU_API_KEY) in CircleCI's project settings. (In case you are not familiar with CircleCI check out CircleCI 2.0 - First Steps)
  9. Now when you commit and push to your repository it will trigger CircleCI build which will deploy your app to Heroku
  10. Once CircleCI build is finished, visit your app on Heroku and verify that it works - https://YOUR_HEROKU_PROJECT_NAME.herokuapp.com/
  11. Celebrate

Alternatives

Another good alternative is to use Stack's docker integration to build a docker image and deploy it to Heroku Container Registry.

yesod-heroku-example's People

Contributors

reneklacan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.