-
-
Notifications
You must be signed in to change notification settings - Fork 256
Expand file tree
/
Copy pathindex.cshtml
More file actions
71 lines (58 loc) · 2.19 KB
/
Copy pathindex.cshtml
File metadata and controls
71 lines (58 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Order: 70
Title: GitHub Actions
Description: Integration with GitHub Actions
---
<h1 id="included-support">Out of the box support</h1>
<p>
The <a href="/api/Cake.Common.Build/BuildSystemAliases/6C2FCAF0">GitHubActions alias</a>, which returns an
<a href="/api/Cake.Common.Build.GitHubActions/IGitHubActionsProvider">IGitHubActionsProvider</a> instance can be used to interact with the GitHub Actions environment.
</p>
<p>
The following example prints if the build is for a pull request running on GitHub Actions:
</p>
<pre><code class="language-csharp hljs">if (BuildSystem.GitHubActions.IsRunningOnGitHubActions)
{
Information(BuildSystem.GitHubActions.Environment.PullRequest.IsPullRequest);
}
else
{
Information("Not running on GitHub Actions");
}</code></pre>
<div class="alert alert-info">
<p>
See <a href="/api/Cake.Common.Build.GitHubActions/IGitHubActionsProvider">IGitHubActionsProvider</a> for details and available methods to interact with GitHub Actions.
</p>
</div>
<h1 id="running-cake">Running Cake</h1>
<p>
The recommended way to run Cake on GitHub Actions is using the <a href="https://github.com/cake-build/cake-action">Cake Action</a>.
This action handles tool restoration and ensures that all GitHub build provider commands work correctly.
</p>
<pre><code class="language-yaml hljs">jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Cake
uses: cake-build/cake-action@v3
with:
cake-version: tool-manifest
</code></pre>
<p>
If you are using <a href="/docs/getting-started/setting-up-a-new-cakesdk-project">Cake.Sdk</a>, you can specify the script file:
</p>
<pre><code class="language-yaml hljs"> - name: Run Cake
uses: cake-build/cake-action@v3
with:
file-path: build.cs
</code></pre>
<h1 id="included-support">Available 3rd party extensions</h1>
@{
var keywords = new List<string> { "githubactions", "github" };
var extensions =
Documents["Extensions"]
.Where(x =>
keywords.Any(y => x.String("Name").ToLowerInvariant().Contains(y)));
}
@Html.Partial("_ExtensionsList", extensions)