
GitHub Actions is my new favorite free programming tool [video] - kmf
https://www.bytesized.xyz/github-actions-tutorial
======
ccleve
I have spent the last two days fighting with these new Github tools. I've been
trying to do a simple Hello-World Maven app, built on Github Actions and
deployed to Github Packages. It does not work.

Github documentation is a disaster. They leave out critical parts. They don't
provide examples. Everything they write is terse, confusing, and incomplete.

They have short little articles on how to do things, and for each sub-task
they have a link to docs somewhere else. This would be fine, except the links
don't point to anything useful.

To give an example: they say you can use the Github API to talk to Github
Packages, but the link goes to their generic GraphQL documentation. They don't
point to any reference material on the actual calls to the packages service.
If it exists, I can't find it.

If you go to the main page in your account for Github Packages, it says that
all you have to do is this:

mvn deploy
-Dregistry=[https://maven.pkg.github.com/mycompany](https://maven.pkg.github.com/mycompany)
-Dtoken=GH_TOKEN

That is just straight-out wrong. It does not work.

Seriously, Github, you need to fire your documentation team and hire some
people who know how to write. Perhaps you should hire people who have actually
used your tools to write the docs. Or just provide some freakin' working
examples.

~~~
ComputerGuru
I am with you on this. It seems to be a new trend: “show users how to do a
hello world” which was disregarded in the past... but somehow that turned into
“instead of providing real documentation” rather than “in addition to.”

It’s not just GitHub. There’s a language I (and the rest of HN) love that has
adopted “story format” for documentation but is missing real, hard technical
documentation apart from method-level codedocs. It’s nice for building
momentum but it leaves you unable to find a central location with an
architectural documentation of the system.

~~~
ben_jones
Someone please tell the Google Cloud Platform teams this. So many hello world
examples which reek of, "I was told to write documentation but I really hate
writing documentation". I mean this in good faith, I think writing
documentation for a product you don't actually use is a miserable experience
and I hope they can find a better balance...

Writing documentation also seems to be a task you kick out to your junior
developers that you'd rather not give more critical assignments to, which is
backwards as can be.

~~~
whoisjuan
If there's one documentation that I hate with my gut, that is GCP
documentation. Like wtf is going on there. Just to give you an example of how
horrible it is, just check their Vision documentation:
[https://cloud.google.com/vision/docs/](https://cloud.google.com/vision/docs/)

They have quick starts, tutorials and how-to-guides. How are even those things
conceptually different at all?. And their reference is just a list of their
methods like if I knew out of the box how to use your API. Like, what the
heck. Just tell me how to talk to your API in simple terms. How hard is it?

"To use the CGP vision API there are two ways to authenticate and connect. 1)
REST 2) SDKS" and then just explain to me how to do it simply.

Don't ramble like if this was the fucking Iliad. Go straight to the point and
organize your information better.

~~~
nullspace
It's possible that I'm jaded by non-existing documentation, but skimming over
the docs in your link, this actually looks like an example of _good_
documentation*

The API reference in particular you pointed to has a top-level description +
linkable reference to each individual method / resource along with brief
description. AND, for older versions, as well as a description of "objects"
used in the API. I guess it would have been nice to also have a sandbox
playground, like some of their other APIs do, but this one is fairly good?

Just curious, what's an example of great API in your mind?

*(possibly not in-depth enough, but I wouldn't be able to tell as a newbie).

~~~
styfle
In this case, google cloud vision, it seems like the docs are fine. It’s the
platform that’s confusing because it requires too much ceremony to get
started.

------
pm90
I would hesitate to build on anything that relies on GitHub native tooling.
GitHub support is absolutely the worst. Their tools fail in weird ways at
times, and without support you will be stuck. For personal/non production
apps, fine. But beware of using it as a core part of your infrastructure.

~~~
penagwin
Thanks for the warning, are there any good tools that integrate with pull
request checks that can be self hosted?

We self host nearly everything at work except for github. (And it's VERY
difficult for me to get anything that costs money approved regardless of
price)

~~~
ethomson
Product Manager for GitHub Actions here. You can self-host the GitHub Actions
runners. This means that you can run CI/CD workflows on your own hardware,
while your source code is hosted on github.com itself.
[https://help.github.com/en/actions/automating-your-
workflow-...](https://help.github.com/en/actions/automating-your-workflow-
with-github-actions/about-self-hosted-runners)

~~~
penagwin
We're currently trying to use Github Actions but we've run into a few issues.
The first is that when our team members push pull requests from their forked
branches it doesn't trigger checks on the pull request. I understand this is
for security reasons, but in our case the repository is private and all forks
are considered trusted.

The other is that there's currently no way to label specific workers. Because
of how our network/firewall is segmented we would like to be able to specify a
worker for Staging/Dev/Production separately. The closest thing I found was
this [0] pull request from October, but it doesn't add the ability to add
custom labels.

Is there any timeline for either of these features (especially the labels)?

[0]
[https://github.com/actions/runner/pull/130](https://github.com/actions/runner/pull/130)

------
kureikain
Github actions is nice but I think they go to wrong direction. The way they
work is you are given an image then you have to use a thing call Github
action, which basically just to extract out into YAML to define a certain
steps for install any dependencies, execute shell script ...

I don't know why they didn't allow us to use any docker image we want so we
don't have to waste time to use actions to install dependencies...Eg, if your
app depend on both Go, Ruby, Node at build time you will need:

[https://github.com/actions/setup-go](https://github.com/actions/setup-go)
[https://github.com/actions/setup-node](https://github.com/actions/setup-node)
[https://github.com/actions/setup-ruby](https://github.com/actions/setup-ruby)

I much prefer CircleCI way

~~~
kwhat4
> I don't know why they didn't allow us to use any docker image we want

Can you imagine allowing anyone on the internet to run an arbitrary container
on your server for free?

~~~
jrockway
That is what every CI service in the world is. Docker doesn't intrinsically
give you any privileges a shell script doesn't, but there is flexibility to
really lock things down (like with gVisor). Of course, a lot of people run the
Docker daemon in such a way as to give containers root access, which isn't
ideal in a shared environment. There is no mandate to do such a thing,
however.

I built an old-style Docker container (i.e., one that runs code like "apt-get
install foo") on Github Actions successfully, so I assume Docker works fine. I
haven't tried getting root on a build worker, but I imagine they mitigate that
in some way. (Perhaps by having a pool of VMs and blowing it up after your
build is done.)

I think what the OP is talking about is CI systems whose pipelines are
declared by a series of "run this command in this container" instructions.
Github Actions doesn't work that way, but you can still run containers.

------
keyP
The GitHub Actions Runner has just been open sourced
[https://github.com/actions/runner](https://github.com/actions/runner)

~~~
ioquatix
That's awesome, thanks for the link. I made an AUR package:
[https://aur.archlinux.org/packages/github-
actions/](https://aur.archlinux.org/packages/github-actions/)

------
ShakataGaNai
Maybe it's changed in the last month or two, but last time I looked at GitHub
actions I couldn't find a single example of "Build docker container and push
to GitHub Packages".

There are a lot of cool examples demo'ing some nifty stuff, but I'd like to
see a lot of _very_ basic examples first. The sort of thing anyone could/would
copy into their project and use, then later learn how to make it fancy.

------
itcrowd
What's up with so many YouTube video's (including this one) having ALL CAPS
titles?! It makes me not want to watch them, although it may be different for
the general public for some reason ... ??

~~~
kej
It's because

YOU WILL NOTICE THIS ONE

in a list of

other normal text

~~~
wescarpenter
I GUESS WE'LL JUST

HAVE TO WAIT UNTIL

EVERY ONE LOOKS LIKE THIS

so then this one

WILL STAND OUT AGAIN?

------
kenver
We managed to move our iOS CI over to this in a couple of days. Produces
multiple independent builds based on branch names, signed with an enterprise
profile for testing and QA. These are uploaded and shared via ms app center.
It also produces our App Store releases signed and uploaded to the App Store
via a regular developer account.

The process was mostly just changing out a Jenkins file to the GitHub yml and
sorting a few issues that cropped up.

------
pavlov
I'd be hesitant to build on GitHub tools that have overlap with anything
Microsoft provides. When something similar is introduced to Azure, why keep
the subsidiary's internal competition around?

This happened already with VS Code vs. Github's Atom editor whose development
has ceased earlier this year. (Not that I ever was a huge fan of Atom, but its
discontinuation is a direct result of the Microsoft acquisition.)

~~~
thinkingkong
Github actions is most definitely using Azure build pipelines behind the
scenes. Microsoft is smart about boosting revenue figures. Id be shocked if
this wasnt the case.

~~~
prepend
I am afraid that Microsoft will kill GitHub stuff in favor of azure stuff, but
I think the risk is low because it seems like GitHub’s whole purchase was for
goodwill.

If I had to bet, I think “azure devops” will go away and GitHub will eat it.

Currently the Actions free tier is cheaper than using azure build pipelines
which is kind of weird, but nice for GitHub users. I think it’s because GitHub
is a limited subset (ie, doesn’t need to support Windows IaaS build types) so
it may be cheaper to run.

~~~
m_ke
I'm convinced their goal is to leverage GitHub to win the cloud wars and that
they'll keep porting all of their Azure products onto it until GitHub is the
cloud provider.

I bet we'll see a click to deploy button on github for most common web
frameworks soon.

Having your git history hooked up to your deployed infrastructure will allow
them to do some amazing things around live debugging. (similar to what google
is doing with cloud source repositories
[https://cloud.google.com/debugger/](https://cloud.google.com/debugger/)).

------
amdelamar
Only thing I don't like about GitHub Actions so far is the YAML structure.
e.g.

    
    
        name: master-pull-request
        on:
          pull_request:
            branches:
              - master
        jobs:
          test:
            name: run tests
            runs-on: ubuntu-18.04
            steps:
              - uses: actions/checkout@v1
              - name: Run gradle test
                run: |
                  ./gradlew test
    

I much prefer Drone CI's YAML:

    
    
        kind: pipeline
        name: default
        steps:
          - name: run tests
            image: openjdk:8-jdk-slim # Docker images!
            commands:
            - ./gradlew test

~~~
edaemon
GitHub's format is like Drone's "multiple pipelines" feature in a single
document instead of separate ones. Drone uses multiple documents that each
define a different set of steps while GitHub does that in a single document
with separate jobs.

It's just an issue of preference, I suppose, but I prefer GitHub's way of
doing things. I find it easier to read and understand.

------
engineeroncall
While it’s not perfect, GitHub Actions was pretty straightforward to set up
for an open source iOS project I help manage[0].

Most of the actions were pre-existing Makefile targets used during the
bootstrap process anyway, so the YAML config was fairly lightweight.

Echoing the other comments in the thread, the docs did feel a bit sparse when
I last poked around (this was back when Actions was still in beta).

[0]
[https://github.com/birdrides/mockingbird](https://github.com/birdrides/mockingbird)

------
louib
I had to setup CI for a GitHub open source project recently, and decided to
give GitHub Actions a try. I have to say it's pretty nice to have the CI
directly handled by GH (GitLab has been doing it for years, I know...). I hope
it's gonna help some open source projects to easily add CI validations to
their PR workflow.

That being said, there was only Ubuntu images for the Linux builds, and I'm
not aware of a way to run custom containers at the moment.

~~~
reilly3000
Most of the Actions are actually custom containers. So to run your own code
you can just make an action, which isn't that complex.

~~~
ethomson
PM for GitHub Actions here. I wouldn't suggest that you build an action to run
a build within a container. We offer container support for workflow runs which
should be suitable for this. (Either by specifying the `jobs.<job-
id>.container` or by using `docker run ...`)

Actions themselves are meant to support the workflow and distill a set of
complex steps into something that can be done in a single workflow command.
(For example, download and set up a new version of a Java JDK.) They're meant
to be used as steps in many peoples workflows, instead of executing a single
workflow.

The actions themselves can be built as either a container, which is self-
contained, or as JavaScript. I often recommend the latter, since that will
work cross platform (containers only work for people who are using workflows
running on Linux).

------
pyr0hu
I really liked GitHub's pipeline description file, but my issue with GH
Actions was that the pipeline was slow. The same job running on the
cheapest/slowest free-tier available Semaphore runner took half the time than
on GitHub. That's with caching, parallelization on GH too.

Otherwise it could be a good product, and I'd really like if I could manage
the repos and the CI from one unified place

------
k__
Tried it out a week ago, but the docs weren't too helpful and the build
templates I found were buggy.

~~~
hanniabu
That seems to br the general sentiment in this thread. I hope somebody of
power within Github is reading this, or someone that can pass the info along
to such a person.

------
darkwater
Free? We are a paying Org and pushed a few test docker images (built via
Actions) to the new Packages (aka GH docker registry) and you have just 2GB
really free (well, included in your plan). Then you have to pay extra. We have
like 80 accounts, already paying a lot of $$$ to GH and they give you 10000
minutes of free Actions - which is cool - but ONLY 2 freaking gigabytes of
storage for free??

------
vageli
How do people test GHA before pushing to github? I encountered a tool or two
to assist but they require the action to be described with HCL not the newer
YAML syntax.

------
karaokeyoga
Outstanding video ... beginner-friendly, great signal-to-noise ratio,
succinct, excellent visuals and a clear voice.

~~~
kmf
hey, thank you so much! I’m super proud of it, been trying to improve every
aspect of my vids from scripting/storyboarding, recording, editing, etc - I
think it all really came together well here!

------
NieDzejkob
@mods As far as I understand, this should be tagged as [video].

~~~
dang
Added. Thanks!

