TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Using my new Raspberry Pi to run an existing GitHub Action

88 点作者 nfrankel大约 1 年前

8 条评论

justinclift大约 1 年前
Self-hosted runners are also useful when debugging weird behaviour in a GitHub Action.<p>I do it by spinning up a VM on my local pc, then running the GitHub Actions software in the VM.<p>This gives a fully working GitHub Actions runner which I can ssh into directly and muck around with to investigate and get things working.<p>It&#x27;s also easy to ensure only the right jobs end up on my runner.<p>The installer for the GitHub Actions runner asks for optional tag names to use, so I add &quot;jc&quot; (my initials) to the tags.<p>Then I add a matching &quot;jc&quot; to the &quot;runs-on&quot; clause in the workflow in my fork or PR:<p><pre><code> runs-on: [self-hosted, linux, x64, jc] </code></pre> With that, the GitHub Actions for that workflow only run on my local VM.<p>Works pretty well. :)<p>---<p>Official docs for the labelling bit: <a href="https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;actions&#x2F;hosting-your-own-runners&#x2F;managing-self-hosted-runners&#x2F;using-self-hosted-runners-in-a-workflow#using-custom-labels-to-route-jobs" rel="nofollow">https:&#x2F;&#x2F;docs.github.com&#x2F;en&#x2F;actions&#x2F;hosting-your-own-runners&#x2F;...</a>
评论 #39678986 未加载
评论 #39678421 未加载
akpa1大约 1 年前
Having recently set up a Gitlab self-hosted runner, the process seems far, far simpler - it&#x27;s a case of running a Docker image on your system (or installing a binary&#x2F;package), registering your runner through Gitlab settings and you&#x27;re finished.<p>It manages running things in other Docker containers for you (or on one of many other runner options) and it worked without any modifications to my workflows. Very pleased with it.
评论 #39679221 未加载
mmastrac大约 1 年前
I have a setup on a Pi for deploying progscrape.com that has a systemd task to boot a new runner in a container. I really need to turn it into a bare-metal deployment script so I can recover from an SD card crash.<p>Basically this service:<p><pre><code> [Unit] Description=%N Container After=docker.service Requires=docker.service [Service] TimeoutSec=3600 Restart=always WorkingDirectory=&#x2F;srv&#x2F;progscrape&#x2F;progscrape-deploy&#x2F;github-runners ExecStartPre=-&#x2F;usr&#x2F;bin&#x2F;docker compose -f %N.yml -p %N stop ExecStartPre=-&#x2F;usr&#x2F;bin&#x2F;docker compose -f %N.yml -p %N pull ExecStart=&#x2F;usr&#x2F;bin&#x2F;docker compose -f %N.yml -p %N up ExecStopPost=-&#x2F;usr&#x2F;bin&#x2F;docker compose -f %N.yml -p %N rm -f [Install] WantedBy=multi-user.target </code></pre> Boots this docker compose definition:<p><pre><code> services: github-docker-runner: image: myoung34&#x2F;github-runner:latest restart: &quot;no&quot; environment: RUNNER_NAME: progscrape-docker-compose RUNNER_WORKDIR: &#x2F;tmp&#x2F;work EPHEMERAL: 1 LABELS: management,linux,ARM64 DISABLE_AUTO_UPDATE: 1 env_file: - github-runner.env configs: - github-runner-start entrypoint: &#x2F;bin&#x2F;sh command: &#x2F;github-runner-start security_opt: # needed on SELinux systems to allow docker container to manage other docker containers - label:disable volumes: - &#x27;&#x2F;var&#x2F;run&#x2F;docker.sock:&#x2F;var&#x2F;run&#x2F;docker.sock&#x27; configs: github-runner-start: file: runner-start.sh</code></pre>
评论 #39677844 未加载
donatj大约 1 年前
I am kind of surprised that the Action runner isn’t just some sort of Container or VM manager like Drone?<p>The runs actually occur on your real OS? That seems strange and dangerous.
评论 #39676956 未加载
评论 #39678157 未加载
greut大约 1 年前
&gt; The script uses systemd underneath.<p>Just show us that mess of your&#x27;s :)
mronetwo大约 1 年前
We&#x27;re running a lot of CI on our custom runners. The fact that it runs in the OS context is a bit meh. If someone has a good resource on setting up docker on a RPi for a custom runner, please throw it my way.
pmarreck大约 1 年前
How do you guys run Github Actions locally?
评论 #39675785 未加载
评论 #39677272 未加载
评论 #39675590 未加载
lostmsu大约 1 年前
BTW if you came here to get your GitHub actions run on ARM64, you don&#x27;t need RPi for that. You can get a free VM from Oracle.
评论 #39678078 未加载