5 ms·
Doing stupid stuff with GitHub Actions
- jcun4128 6y agonice site, it's clean
- benatkin 6y agoIt's nice but it could be cleaner, by dropping the sidebar, and constraining the width of prose. See "Why is the text on your site so narrow? It wastes screen space." here: http://www.paulgraham.com/gfaq.html http://www.paulgraham.com/gfaq.html
- 0xbkt 6y agoIs it any better to use images for styling buttons instead of CSS?
- spalas 6y agoThanks! Most of the credit goes to Alex Shpak (https://github.com/alex-shpak/ https://github.com/alex-shpak/) who created the "Book" theme for hugo (https://themes.gohugo.io/hugo-book/ https://themes.gohugo.io/hugo-book/).
- ViViDboarder 6y agoAlso loaded very quickly for me. Static sites FTW!
- spalas 6y ago...and its hosted on an f1-micro instance! (https://devopsdirective.com/posts/2020/03/load-testing-f1-micro/ https://devopsdirective.com/posts/2020/03/load-testing-f1-mi...) Almost all of the load is handled by CloudFlare though.
- jarv 6y agoJust curious - why didn't you decide to serve the site from object storage?
- spalas 6y agoMostly because I knew I wanted to play around with trying out different configurations, testing performance, etc... If I didn't have those secondary goals, I would have either: 1) Hosted on Netlify OR 2) Hosted in an S3 / GCS bucket
- jarv 6y agocool - and the micro instance is free anyway
- TedDoesntTalk 6y agoI rarely see a sense of humor on HN. It’s a nice surprise and I hope to see more of it. Nice job!
- spalas 6y agoI'm glad you enjoyed it! I figured if I was going to learn a new tool, I might as well have some fun along the way!
- simonw 6y agoI really enjoyed Jonty Wareing's hack recently where he built a static site generator inside a GitHub Action that works by doing the following: 1. Spin up a Python Flask web server on localhost 2. Run "wget --mirror" against it to crawl the site and save it as static files 3. Publish the resulting static files to GitHub Pages The workflow is here. It's genius: https://github.com/pubstandards/pubstandards-london/blob/89989bd3e3e2391425bc8e76055e90892635ec5a/.github/workflows/build.yml https://github.com/pubstandards/pubstandards-london/blob/899...
- gjulianm 6y agoIt's not often that I see things that are stupid but smart at the same time, so cool!
- buzzerbetrayed 6y agoGenuine question: what is smart about this? What is the reasoning for not just writing the static assets by hand?
- withinboredom 6y agoSome possibilities come to mind: 1. because the people writing the content are not developers. 2. there’s dynamic content, but when you know you’re going to get a large influx of traffic from a single region/event, you can precompute it for a short period.
- simonw 6y agoThe site already existed, but they wanted to serve it statically to save on complexity and money. If you dig into the repo you'll see that it's maintained using a YAML file, which is a smart way to deal with small sites that still contain structured content. I do the same thing for my https://github.com/simonw/museums https://github.com/simonw/museums site.
- gjulianm 6y agoIt's smart because it's a solution to a problem (freezing dynamic content) in one line of code, the wget command. It should work for most cases and it's easy to understand and deploy.
- caiobegotti 6y agoThe "Holiday Reminder" could actually send a somewhat puzzling notification about you needing to check out the GitHub pipeline for a production failure. I would for sure forget about even setting it up and would shit my pants on New Year's Eve... and then have a good laugh on myself.
- spalas 6y agoHaha, good point... I have another 5 months to fully forget that I ever set this up. The name of the action does get included in the email notification so hopefully I'll be able to decypher it, even after some NYE celebration champagne!
- KarlKode 6y agoYou could set up a weekly failing job that reminds you ;)
- davnicwil 6y agoFor anybody interested in playing around with and hacking on different CI / devops stuff I recently launched https://boxci.dev https://boxci.dev, which is a distributed CI service where the builds run on your own hardware, via a lightweight runner that just does coordination and runs build shell commands on bare metal, so it's a bit more hackable / flexible than (for instance) GH actions / Gitlab CI. It's free to sign up and play around with it, and I'd love to get the feedback of any HNs who think this could be useful (I basically built it because it's the CI service I want to exist, and I think others might too).
- iampims 6y agoneat. Looks similar to https://buildkite.com https://buildkite.com .
- paulannesley 6y agoYep! We've been doing this at Buildkite for six years now. We're lucky to have a lot of fantastic customers who have helped us learn over the years what makes a great hybrid SaaS/self-hosted CI solution.
- jacobparker 6y ago> where the builds run on your own hardware This is possible with GitHub Actions, too: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners https://docs.github.com/en/actions/hosting-your-own-runners/... (the place I work at uses it.)
- oars 6y agoThis looks awesome. As someone who's a bit newer to CI/CD, this solution would be ideal if you don't want to host Jenkins yourself right? I just give you access to my GitHub repos, install the agent then whenever I commit something into GitHub, the agent will see this and perform the task/pipeline right? Similarly to how Jenkins works, except I don't need to install Jenkins - I just install the agent instead.
- 6y ago
- smichel17 6y agoAlternative idea for exponential action: action that creates another action (automate a headless browser, or maybe github has an api for that?). Kill switch: delete the repo :)
- Nekorosu 6y agoThe real question is, are Github Actions Turing complete?
- chrisseaton 6y agoYes you can run arbitrary code in them.
- swyx 6y agoI've used GH Actions to replicate LinkedIn's Endorsements feature on their new Profile Readme feature: https://github.com/sw-yx/sw-yx https://github.com/sw-yx/sw-yx
- ihaveajob 6y agoReminds me of my first year in college, when we'd log into each other's machines at the computer lab for some intro to computing class, and launch a fork-bomb script that simply launched itself twice, quickly rendering the machine useless. The tricky part was to test it without halting your own machine, as a newbie programmer and Unix user.
- spalas 6y agoHaha - We have it too easy these days and can just spin up a VM with Virtual Box (or similar) to test stuff like this.
- stevehiehn 6y agoI work on a product similar to Github Actions: https://cto.ai/ https://cto.ai/ but there is a built in interaction layer for interacting from Slack channels.
- tarulahsan 6y agoI was reading all the comments and found it really interesting. Thanks for the post.
- geokon 6y agoUnlike the authoer, I haven't found Github Actions very intuitive to work with :) I've asked this before on a similar post, maybe someone here knows. Has anyone managed to get a Pre-Release to track Master using Github Actions? I can't seem to find a working example that does this (and I can't seem to cobble one together myself) There are a few things that are seemingly intentionally left out of GitHub Actions... like you can create new Releases on a push, but there is no direct way to delete/update a release with fresh builds. I know you can just get build artifacts - but those are not publicly available and hard to link people to.
- spalas 6y agoI think you could build on this action https://github.com/actions/github-script/ https://github.com/actions/github-script/ which provides a JS client for the GitHub API. It looks like it supports all of the API routes you would need including: https://github.com/actions/github-script/blob/b507739f17c2106b2a1a596000eaa49a0d5c33a2/dist/index.js#L9514 https://github.com/actions/github-script/blob/b507739f17c210... To actually perform the release update.
- geokon 6y agoit's strange to me this isn't a first class feature Thanks for the tip. I don't really know JS so I may dig into this if it becomes a major burden. For the time being I'll just manually delete the prerelease between pushes
- darekkay 6y agoWith the new GitHub profile README feature, GitHub Actions gained a lot of traction. I'm using it to automatically display my latest blog post [1]. [1] https://darekkay.com/blog/github-profile-readme/ https://darekkay.com/blog/github-profile-readme/