Files
devstar_introduction/docs/.vitepress/dist/assets/runner_index.md.D07NDeB4.js
yinxue 6e6f51765c
Some checks failed
CI Pipeline / build (push) Failing after 1m9s
实现打包
2025-08-11 20:13:16 +08:00

15 lines
11 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as e,c as s,o as i,ag as n}from"./chunks/framework.S-Qvb3wi.js";const k=JSON.parse('{"title":"What is Gitea Runner","description":"","frontmatter":{"sidebar_position":1,"slug":"/"},"headers":[],"relativePath":"runner/index.md","filePath":"runner/index.md"}'),t={name:"runner/index.md"};function r(l,a,h,p,o,d){return i(),s("div",null,a[0]||(a[0]=[n(`<h1 id="what-is-gitea-runner" tabindex="-1">What is Gitea Runner <a class="header-anchor" href="#what-is-gitea-runner" aria-label="Permalink to &quot;What is Gitea Runner&quot;"></a></h1><p>Act runner is a runner for Gitea based on <a href="https://gitea.com/gitea/act" target="_blank" rel="noreferrer">Gitea fork</a> of <a href="https://github.com/nektos/act" target="_blank" rel="noreferrer">act</a>. This documentation is a copy of <a href="https://gitea.com/gitea/act_runner/src/branch/main/README.md" target="_blank" rel="noreferrer">https://gitea.com/gitea/act_runner/src/branch/main/README.md</a> . And it should be updated once that README changed.</p><h2 id="installation" tabindex="-1">Installation <a class="header-anchor" href="#installation" aria-label="Permalink to &quot;Installation&quot;"></a></h2><h3 id="prerequisites" tabindex="-1">Prerequisites <a class="header-anchor" href="#prerequisites" aria-label="Permalink to &quot;Prerequisites&quot;"></a></h3><p>Docker Engine Community version is required for docker mode. To install Docker CE, follow the official <a href="https://docs.docker.com/engine/install/" target="_blank" rel="noreferrer">install instructions</a>.</p><h3 id="download-pre-built-binary" tabindex="-1">Download pre-built binary <a class="header-anchor" href="#download-pre-built-binary" aria-label="Permalink to &quot;Download pre-built binary&quot;"></a></h3><p>Visit <a href="https://dl.gitea.com/act_runner/" target="_blank" rel="noreferrer">here</a> and download the right version for your platform.</p><h3 id="build-from-source" tabindex="-1">Build from source <a class="header-anchor" href="#build-from-source" aria-label="Permalink to &quot;Build from source&quot;"></a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> build</span></span></code></pre></div><h3 id="build-a-docker-image" tabindex="-1">Build a docker image <a class="header-anchor" href="#build-a-docker-image" aria-label="Permalink to &quot;Build a docker image&quot;"></a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">make</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span></span></code></pre></div><h3 id="register" tabindex="-1">Register <a class="header-anchor" href="#register" aria-label="Permalink to &quot;Register&quot;"></a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./act_runner</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> register</span></span></code></pre></div><p>And you will be asked to input:</p><ol><li>Gitea instance URL, like <code>http://192.168.8.8:3000/</code>. You should use your gitea instance ROOT_URL as the instance argument and you should not use <code>localhost</code> or <code>127.0.0.1</code> as instance IP;</li><li>Runner token, you can get it from <code>http://192.168.8.8:3000/-/admin/actions/runners</code>;</li><li>Runner name, you can just leave it blank;</li><li>Runner labels, you can just leave it blank.</li></ol><p>The process looks like:</p><div class="language-text vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">text</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>INFO Registering runner, arch=amd64, os=darwin, version=0.1.5.</span></span>
<span class="line"><span>WARN Runner in user-mode.</span></span>
<span class="line"><span>INFO Enter the Gitea instance URL (for example, https://gitea.com/):</span></span>
<span class="line"><span>http://192.168.8.8:3000/</span></span>
<span class="line"><span>INFO Enter the runner token:</span></span>
<span class="line"><span>fe884e8027dc292970d4e0303fe82b14xxxxxxxx</span></span>
<span class="line"><span>INFO Enter the runner name (if set empty, use hostname: Test.local):</span></span>
<span class="line"><span></span></span>
<span class="line"><span>INFO Enter the runner labels, leave blank to use the default labels (comma-separated, for example, ubuntu-latest:docker://gitea/runner-images:ubuntu-latest):</span></span>
<span class="line"><span></span></span>
<span class="line"><span>INFO Registering runner, name=Test.local, instance=http://192.168.8.8:3000/, labels=[ubuntu-latest:docker://gitea/runner-images:ubuntu-latest ubuntu-22.04:docker://gitea/runner-images:ubuntu-22.04 ubuntu-20.04:docker://gitea/runner-images:ubuntu-20.04].</span></span>
<span class="line"><span>DEBU Successfully pinged the Gitea instance server</span></span>
<span class="line"><span>INFO Runner registered successfully.</span></span></code></pre></div><p>You can also register with command line arguments.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./act_runner</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> register</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --instance</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> http://192.168.8.8:3000</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --token</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">my_runner_toke</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --no-interactive</span></span></code></pre></div><p>If the registry succeed, it will run immediately. Next time, you could run the runner directly.</p><h3 id="run" tabindex="-1">Run <a class="header-anchor" href="#run" aria-label="Permalink to &quot;Run&quot;"></a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./act_runner</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> daemon</span></span></code></pre></div><h3 id="run-with-docker" tabindex="-1">Run with docker <a class="header-anchor" href="#run-with-docker" aria-label="Permalink to &quot;Run with docker&quot;"></a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> run</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> GITEA_INSTANCE_URL=https://your_gitea.com</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -e</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> GITEA_RUNNER_REGISTRATION_TOKEN=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">your_toke</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">n</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -v</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /var/run/docker.sock:/var/run/docker.sock</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --name</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> my_runner</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> gitea/act_runner:nightly</span></span></code></pre></div><h3 id="configuration" tabindex="-1">Configuration <a class="header-anchor" href="#configuration" aria-label="Permalink to &quot;Configuration&quot;"></a></h3><p>You can also configure the runner with a configuration file. The configuration file is a YAML file, you can generate a sample configuration file with <code>./act_runner generate-config</code>.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./act_runner</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> generate-config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> config.yaml</span></span></code></pre></div><p>You can specify the configuration file path with <code>-c</code>/<code>--config</code> argument.</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./act_runner</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> config.yaml</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> register</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # register with config file</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./act_runner</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -c</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> config.yaml</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> daemon</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # run with config file</span></span></code></pre></div><p>You can read the latest version of the configuration file online at <a href="internal/pkg/config/config.example.yaml">config.example.yaml</a>.</p><h3 id="example-deployments" tabindex="-1">Example Deployments <a class="header-anchor" href="#example-deployments" aria-label="Permalink to &quot;Example Deployments&quot;"></a></h3><p>Check out the <a href="https://gitea.com/gitea/act_runner/src/branch/main/examples" target="_blank" rel="noreferrer">examples</a> directory for sample deployment types.</p>`,32)]))}const u=e(t,[["render",r]]);export{k as __pageData,u as default};