Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create templates for building on GitLab and GitHub pages #6

Closed
heyakyra opened this issue Jun 26, 2019 · 7 comments

Comments

Projects
None yet
2 participants
@heyakyra
Copy link

commented Jun 26, 2019

The current instructions to get started with Elmstatic nicely build a site which can then be uploaded to a static site host: https://korban.net/elm/elmstatic/

I think this requires that the built site files be committed and uploaded, rather than having just the code itself uploaded and having the CI build it appropriately. Would it be possible to publish starter templates for GitLab/GitHub pages to do this (either in separate repos, or with a page documenting a working config file as Hugo does)?

I'm new to Elm and Elmstatic but I would like to be able to manage it with Netlify CMS and host it on GitLab pages. The documentation for the former now lists Elmstatic after I created a merge request to do so! Hopefully that brings more attention to Elm and Elmstatic from Netlify CMS users 🙂

@alexkorban

This comment has been minimized.

Copy link
Owner

commented Jun 26, 2019

Thanks for adding Elmstatic to the docs!

I haven't used Netlify or GitLab, so could you please clarify the difference between Netlify and Netlify CMS for me? I had the impression that the output of Elmstatic could be hosted on Netlify the hosting platform (by connecting to a repo on GitHub or GitLab). But how does Netlify CMS fit into this? What does it do with the static files?

@heyakyra

This comment has been minimized.

Copy link
Author

commented Jun 27, 2019

You're welcome! I hope more people start using it.

Netlify is a hosting platform, but Netlify CMS is an open source CMS that can integrate with static site generators to manage the content (markdown files, etc) in a friendly way to non-coders. But Netlify CMS isn't relevant to this, I was just oversharing my motivations, so for the bug report just ignore the last paragraph sorry!

@heyakyra

This comment has been minimized.

Copy link
Author

commented Jul 2, 2019

This took me forever to figure out due to this caching issue: elm/compiler#1845

but I believe the .gitlab-ci.yml file should look like this for deploying to GitLab:

image: node:current

pages:
  cache:
    paths:
    - node_modules
    - /root/.elm
    - elm-stuff
  script:
  - npm install -g elm --unsafe-perm=true
  - npm install -g elmstatic
  - elmstatic
  - mv _site public
  artifacts:
    paths:
      - public
  only:
    - master

also make sure .gitignore includes:

elm.js
elm-stuff/
_site/
@alexkorban

This comment has been minimized.

Copy link
Owner

commented Jul 2, 2019

Nice! What would be useful for me to do? Should I include this file in the repo, or show it in the docs?

By the way, Elmstatic could generate the site directly in public by setting outputDir: public in config.json. Then the mv step would not be needed (but of course people would need to update config.json appropriately).

@heyakyra

This comment has been minimized.

Copy link
Author

commented Jul 2, 2019

Nice! What would be useful for me to do? Should I include this file in the repo, or show it in the docs?

Probably not worth adding files that not everyone needs to the repo, but either:

  • show it in the docs and/or...
  • have a separate repo on gitlab as an example deployment

would be good!

By the way, Elmstatic could generate the site directly in public by setting outputDir: public in config.json. Then the mv step would not be needed (but of course people would need to update config.json appropriately).

Oh, thanks! Very useful, although I'm not sure what the best approach is (minimal changes to Elmstatic defaults vs minimal steps for GitLab CI)

@alexkorban

This comment has been minimized.

Copy link
Owner

commented Jul 2, 2019

Ok, will add it to the docs.

@alexkorban

This comment has been minimized.

Copy link
Owner

commented Jul 4, 2019

Added a Deployment section to the docs: https://korban.net/elm/elmstatic/
Thank you @heyakyra!

@alexkorban alexkorban closed this Jul 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.